From 34835cc9760eda90b9009d6a369a2ea1d86d43bb Mon Sep 17 00:00:00 2001 From: Evandro Junior Date: Mon, 14 Apr 2014 14:41:15 +0000 Subject: [PATCH] twitter restored --- plugins/community_hub/lib/community_hub_plugin/hub.rb | 2 +- plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb | 5 +++-- plugins/community_hub/tweeter_stream/lib/twurl/stream.rb | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/community_hub/lib/community_hub_plugin/hub.rb b/plugins/community_hub/lib/community_hub_plugin/hub.rb index c83bffd..4faf285 100644 --- a/plugins/community_hub/lib/community_hub_plugin/hub.rb +++ b/plugins/community_hub/lib/community_hub_plugin/hub.rb @@ -38,7 +38,7 @@ class CommunityHubPlugin::Hub < Folder if action==:start thread = Thread.new { Twurl::Stream.run(page, author_id,'torrent', File.dirname(__FILE__) + '/../../tweeter_stream/config/twurlrc') - } unless@@twitter_thread_started + } unless@@twitter_thread_started @@twitter_thread_started = true end end diff --git a/plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb b/plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb index 2f31db2..f761183 100755 --- a/plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb +++ b/plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb @@ -14,17 +14,18 @@ module Twurl def perform_request client.perform_request_from_options(options) { |response| response.read_body { |chunk| -# print "#{chunk}\n" +# print "#{chunk}\n" #unless chunk.to_i.length = 0 begin parsed = JSON.parse(chunk) -# print "@#{parsed["user"]["name"]} said: #{parsed["text"]} \n" + print "@#{parsed["user"]["name"]} said: #{parsed["text"]} \n" comment = Comment.new comment.source_id = Stream.page.id comment.body = parsed["text"] comment.author_id = Stream.author_id comment.save! rescue + print "Erro gravando comentário twitter\n" end #raise comment.inspect # rescue diff --git a/plugins/community_hub/tweeter_stream/lib/twurl/stream.rb b/plugins/community_hub/tweeter_stream/lib/twurl/stream.rb index ddbc45e..d83313d 100755 --- a/plugins/community_hub/tweeter_stream/lib/twurl/stream.rb +++ b/plugins/community_hub/tweeter_stream/lib/twurl/stream.rb @@ -17,7 +17,6 @@ module Twurl @page = page # maybe should not be a class variable @author_id = author_id @@file_path = config_file_path - raise page.inspect Twurl.options = Options.new Twurl.options.command = 'request' # Not necessary anymore Twurl.options.data = {"track"=>tags} -- libgit2 0.21.2