Commit 34835cc9760eda90b9009d6a369a2ea1d86d43bb

Authored by Evandro Junior
1 parent 3a43f458

twitter restored

plugins/community_hub/lib/community_hub_plugin/hub.rb
@@ -38,7 +38,7 @@ class CommunityHubPlugin::Hub < Folder @@ -38,7 +38,7 @@ class CommunityHubPlugin::Hub < Folder
38 if action==:start 38 if action==:start
39 thread = Thread.new { 39 thread = Thread.new {
40 Twurl::Stream.run(page, author_id,'torrent', File.dirname(__FILE__) + '/../../tweeter_stream/config/twurlrc') 40 Twurl::Stream.run(page, author_id,'torrent', File.dirname(__FILE__) + '/../../tweeter_stream/config/twurlrc')
41 - } unless@@twitter_thread_started 41 + } unless@@twitter_thread_started
42 @@twitter_thread_started = true 42 @@twitter_thread_started = true
43 end 43 end
44 end 44 end
plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb
@@ -14,17 +14,18 @@ module Twurl @@ -14,17 +14,18 @@ module Twurl
14 def perform_request 14 def perform_request
15 client.perform_request_from_options(options) { |response| 15 client.perform_request_from_options(options) { |response|
16 response.read_body { |chunk| 16 response.read_body { |chunk|
17 -# print "#{chunk}\n" 17 +# print "#{chunk}\n"
18 #unless chunk.to_i.length = 0 18 #unless chunk.to_i.length = 0
19 begin 19 begin
20 parsed = JSON.parse(chunk) 20 parsed = JSON.parse(chunk)
21 -# print "@#{parsed["user"]["name"]} said: #{parsed["text"]} \n" 21 + print "@#{parsed["user"]["name"]} said: #{parsed["text"]} \n"
22 comment = Comment.new 22 comment = Comment.new
23 comment.source_id = Stream.page.id 23 comment.source_id = Stream.page.id
24 comment.body = parsed["text"] 24 comment.body = parsed["text"]
25 comment.author_id = Stream.author_id 25 comment.author_id = Stream.author_id
26 comment.save! 26 comment.save!
27 rescue 27 rescue
  28 + print "Erro gravando comentário twitter\n"
28 end 29 end
29 #raise comment.inspect 30 #raise comment.inspect
30 # rescue 31 # rescue
plugins/community_hub/tweeter_stream/lib/twurl/stream.rb
@@ -17,7 +17,6 @@ module Twurl @@ -17,7 +17,6 @@ module Twurl
17 @page = page # maybe should not be a class variable 17 @page = page # maybe should not be a class variable
18 @author_id = author_id 18 @author_id = author_id
19 @@file_path = config_file_path 19 @@file_path = config_file_path
20 - raise page.inspect  
21 Twurl.options = Options.new 20 Twurl.options = Options.new
22 Twurl.options.command = 'request' # Not necessary anymore 21 Twurl.options.command = 'request' # Not necessary anymore
23 Twurl.options.data = {"track"=>tags} 22 Twurl.options.data = {"track"=>tags}