diff --git a/plugins/community_hub/tweeter_stream/Gemfile b/plugins/community_hub/tweeter_stream/Gemfile index 3d56462..b0e55a1 100755 --- a/plugins/community_hub/tweeter_stream/Gemfile +++ b/plugins/community_hub/tweeter_stream/Gemfile @@ -2,6 +2,7 @@ source 'https://rubygems.org' gem 'jruby-openssl', :platforms => :jruby gem 'rake' +gem 'json' group :test do gem 'coveralls', :require => false diff --git a/plugins/community_hub/tweeter_stream/Gemfile.lock b/plugins/community_hub/tweeter_stream/Gemfile.lock new file mode 100644 index 0000000..378db8f --- /dev/null +++ b/plugins/community_hub/tweeter_stream/Gemfile.lock @@ -0,0 +1,49 @@ +PATH + remote: . + specs: + twurl (0.9.2) + oauth (~> 0.4) + +GEM + remote: https://rubygems.org/ + specs: + coveralls (0.7.0) + multi_json (~> 1.3) + rest-client + simplecov (>= 0.7) + term-ansicolor + thor + docile (1.1.3) + json (1.8.1) + mime-types (1.25.1) + minitest (5.3.2) + multi_json (1.9.2) + oauth (0.4.7) + rake (10.2.2) + rest-client (1.6.7) + mime-types (>= 1.16) + rr (1.1.2) + simplecov (0.8.2) + docile (~> 1.1.0) + multi_json + simplecov-html (~> 0.8.0) + simplecov-html (0.8.0) + term-ansicolor (1.3.0) + tins (~> 1.0) + thor (0.19.1) + tins (1.1.0) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 1.0) + coveralls + jruby-openssl + json + mime-types (~> 1.25) + minitest (>= 5) + rake + rr (>= 1.1) + simplecov + twurl! 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 f179e42..75ca11d 100755 --- a/plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb +++ b/plugins/community_hub/tweeter_stream/lib/twurl/request_controller.rb @@ -1,3 +1,5 @@ +require "json" + module Twurl class RequestController < AbstractCommandController NO_URI_MESSAGE = "No URI specified" @@ -11,7 +13,9 @@ module Twurl def perform_request client.perform_request_from_options(options) { |response| - response.read_body { |chunk| Stream.print chunk } + response.read_body { |chunk| parsed = JSON.parse(chunk) + print parsed["text"] + "\n" + } } rescue URI::InvalidURIError Stream.puts NO_URI_MESSAGE -- libgit2 0.21.2