sentra 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sentra/version.rb +1 -1
- data/lib/sentra.rb +14 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dfcdf2f0d7dce623fb2a226db8f33bd97808fcf
|
4
|
+
data.tar.gz: d5488cfdf942103d1e0a78d3e6155935dd804cbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: febd9c11d1224d84d6875d50fcce314ab2bbca4cf40d67548526ddd72cdead1f99958e5669321b631c2e56a62cc61279d66d920d754039cdab4848208d8304f8
|
7
|
+
data.tar.gz: ee89d92cdbd4b4fdc5f0b84c40ad3d102d43f3bf81c256b1a52d4b1fd5a4a29eb20d58dccb5a3e5427e5e994a3e27429547e1d0a8d3d1e267d2d04e633eb69da
|
data/lib/sentra/version.rb
CHANGED
data/lib/sentra.rb
CHANGED
@@ -17,7 +17,7 @@ module Sentra
|
|
17
17
|
class SentraService < Sinatra::Base
|
18
18
|
configure do
|
19
19
|
|
20
|
-
config_path = Dir.pwd
|
20
|
+
config_path = Dir.pwd + "/config.yml"
|
21
21
|
p config_path
|
22
22
|
if File.exists? config_path
|
23
23
|
topolog_settings = YAML.load_file config_path
|
@@ -73,8 +73,12 @@ module Sentra
|
|
73
73
|
|
74
74
|
list = java.util.ArrayList.new
|
75
75
|
query.each_with_index do |tweet, index|
|
76
|
-
|
77
|
-
|
76
|
+
if tweet.has_key? 'content' and tweet['content'] and tweet['content'].size > 4
|
77
|
+
list.add(tweet['content'])
|
78
|
+
else
|
79
|
+
list.add("Test.")
|
80
|
+
end
|
81
|
+
#p tweet['content']
|
78
82
|
end
|
79
83
|
|
80
84
|
responses = []
|
@@ -83,11 +87,16 @@ module Sentra
|
|
83
87
|
settings.spout.putArticle(key, list);
|
84
88
|
article_cl = settings.bolt.getArticle(key)
|
85
89
|
|
86
|
-
|
87
|
-
# p article_cl
|
90
|
+
|
88
91
|
article_cl.each { |a|
|
92
|
+
begin
|
93
|
+
|
89
94
|
facts = a.getMetadata('twitter').getFacts()
|
90
95
|
responses.push(process_result(facts))
|
96
|
+
rescue Exception => e
|
97
|
+
puts "Problems with article"
|
98
|
+
end
|
99
|
+
|
91
100
|
}
|
92
101
|
|
93
102
|
responses.to_json
|