sentra 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sentra/version.rb +1 -1
  3. data/lib/sentra.rb +14 -5
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9c2f8bf1e6d2f31e9d767d283b849fe7208ebfc
4
- data.tar.gz: 34733682205e26ffba46d5623650bcdf283fd31b
3
+ metadata.gz: 2dfcdf2f0d7dce623fb2a226db8f33bd97808fcf
4
+ data.tar.gz: d5488cfdf942103d1e0a78d3e6155935dd804cbc
5
5
  SHA512:
6
- metadata.gz: 789097a25cca228dcebd5376a3a3f1ae23cdff4e4fc9452ddde26d1c6bd8ee8d06722d5cb126e440da2b24fe3d95530a0e435b0bbd9e23e024f5aec202a41e08
7
- data.tar.gz: f4ac7f12941ac960f5cc675932b854b825599162dd3eadd85f236289462312610696f27d25d6e38466011764e84ddffb3a942e8b8c3c04a138e3bffd3195b795
6
+ metadata.gz: febd9c11d1224d84d6875d50fcce314ab2bbca4cf40d67548526ddd72cdead1f99958e5669321b631c2e56a62cc61279d66d920d754039cdab4848208d8304f8
7
+ data.tar.gz: ee89d92cdbd4b4fdc5f0b84c40ad3d102d43f3bf81c256b1a52d4b1fd5a4a29eb20d58dccb5a3e5427e5e994a3e27429547e1d0a8d3d1e267d2d04e633eb69da
@@ -1,3 +1,3 @@
1
1
  module Sentra
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
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 + "/config.yml"
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
- list.add(tweet['content'])
77
- p tweet['content']
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
- # puts "next"
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - kshakirov