diff --git a/twitter-stream-listener/.bundle/install.log b/twitter-stream-listener/.bundle/install.log new file mode 100644 index 0000000..db28a66 --- /dev/null +++ b/twitter-stream-listener/.bundle/install.log @@ -0,0 +1,24 @@ +# Logfile created on Tue Apr 01 15:04:11 -0300 2014 by logger.rb/1.2.6 +I, [2014-04-01T15:04:11.169252 #3872] INFO -- : 0: addressable (2.3.6) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/addressable-2.3.6.gemspec +I, [2014-04-01T15:04:15.337466 #3872] INFO -- : 0: atomic (1.1.16) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/atomic-1.1.16.gemspec +I, [2014-04-01T15:04:16.238529 #3872] INFO -- : 0: buftok (0.2.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/buftok-0.2.0.gemspec +I, [2014-04-01T15:04:17.506979 #3872] INFO -- : 0: cookiejar (0.3.2) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/cookiejar-0.3.2.gemspec +I, [2014-04-01T15:04:19.059662 #3872] INFO -- : 0: daemons (1.1.9) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/daemons-1.1.9.gemspec +I, [2014-04-01T15:04:32.866846 #3872] INFO -- : 0: eventmachine (1.0.3) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/eventmachine-1.0.3.gemspec +I, [2014-04-01T15:04:34.487840 #3872] INFO -- : 0: em-socksify (0.3.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/em-socksify-0.3.0.gemspec +I, [2014-04-01T15:04:37.910469 #3872] INFO -- : 0: http_parser.rb (0.6.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/http_parser.rb-0.6.0.gemspec +I, [2014-04-01T15:04:40.571077 #3872] INFO -- : 0: em-http-request (1.1.2) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/em-http-request-1.1.2.gemspec +I, [2014-04-01T15:04:41.537112 #3872] INFO -- : 0: simple_oauth (0.2.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/simple_oauth-0.2.0.gemspec +I, [2014-04-01T15:04:42.889153 #3872] INFO -- : 0: em-twitter (0.3.3) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/em-twitter-0.3.3.gemspec +I, [2014-04-01T15:04:43.925324 #3872] INFO -- : 0: equalizer (0.0.9) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/equalizer-0.0.9.gemspec +I, [2014-04-01T15:04:44.873338 #3872] INFO -- : 0: multipart-post (2.0.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/multipart-post-2.0.0.gemspec +I, [2014-04-01T15:04:47.163595 #3872] INFO -- : 0: faraday (0.9.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/faraday-0.9.0.gemspec +I, [2014-04-01T15:04:48.595897 #3872] INFO -- : 0: http (0.5.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/http-0.5.0.gemspec +I, [2014-04-01T15:04:48.596578 #3872] INFO -- : 0: json (1.8.1) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/json-1.8.1.gemspec +I, [2014-04-01T15:04:51.014435 #3872] INFO -- : 0: thread_safe (0.3.1) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/thread_safe-0.3.1.gemspec +I, [2014-04-01T15:04:52.128708 #3872] INFO -- : 0: memoizable (0.4.2) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/memoizable-0.4.2.gemspec +I, [2014-04-01T15:04:53.218012 #3872] INFO -- : 0: multi_json (1.9.2) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/multi_json-1.9.2.gemspec +I, [2014-04-01T15:04:54.541761 #3872] INFO -- : 0: naught (1.0.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/naught-1.0.0.gemspec +I, [2014-04-01T15:04:57.832182 #3872] INFO -- : 0: twitter (5.8.0) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/twitter-5.8.0.gemspec +I, [2014-04-01T15:04:59.365999 #3872] INFO -- : 0: tweetstream (2.6.1) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374/specifications/tweetstream-2.6.1.gemspec +I, [2014-04-01T15:04:59.366614 #3872] INFO -- : 0: bundler (1.5.1) from /home/80129498572/.rvm/gems/ruby-1.8.7-p374@global/specifications/bundler-1.5.1.gemspec diff --git a/twitter-stream-listener/Gemfile b/twitter-stream-listener/Gemfile new file mode 100644 index 0000000..6ab8219 --- /dev/null +++ b/twitter-stream-listener/Gemfile @@ -0,0 +1,3 @@ +source 'http://rubygems.org' + +gem 'twitter' diff --git a/twitter-stream-listener/Gemfile.lock b/twitter-stream-listener/Gemfile.lock new file mode 100644 index 0000000..4ecb5b5 --- /dev/null +++ b/twitter-stream-listener/Gemfile.lock @@ -0,0 +1,37 @@ +GEM + remote: http://rubygems.org/ + specs: + addressable (2.3.6) + atomic (1.1.16) + buftok (0.2.0) + equalizer (0.0.9) + faraday (0.9.0) + multipart-post (>= 1.2, < 3) + http (0.5.0) + http_parser.rb + http_parser.rb (0.6.0) + json (1.8.1) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + multipart-post (2.0.0) + naught (1.0.0) + simple_oauth (0.2.0) + thread_safe (0.3.1) + atomic (>= 1.1.7, < 2) + twitter (5.8.0) + addressable (~> 2.3) + buftok (~> 0.2.0) + equalizer (~> 0.0.9) + faraday (~> 0.9.0) + http (~> 0.5.0) + http_parser.rb (~> 0.6.0) + json (~> 1.8) + memoizable (~> 0.4.0) + naught (~> 1.0) + simple_oauth (~> 0.2.0) + +PLATFORMS + ruby + +DEPENDENCIES + twitter diff --git a/twitter-stream-listener/stream.rb b/twitter-stream-listener/stream.rb new file mode 100644 index 0000000..6ad9880 --- /dev/null +++ b/twitter-stream-listener/stream.rb @@ -0,0 +1,36 @@ + +require 'twitter' +require 'json' + +#client = Twitter::REST::Client.new do |config| + + +client = Twitter::Streaming::Client.new do |config| + config.consumer_key = ENV['TWITTER_CONSUMER_KEY'] + config.consumer_secret = ENV['TWITTER_CONSUMER_SECRET'] + config.oauth_token = ENV['TWITTER_OAUTH_TOKEN'] + config.oauth_token_secret = ENV['TWITTER_OAUTH_TOKEN_SECRET'] +end + +topics = ["#nba"] + +client.filter(:track => topics.join(",")) do |object| + puts object.to_h.to_json if object.is_a?(Twitter::Tweet) +end + + + +#FACEBOOK + +#feed do participa +# precisa do access_token da comunidade participa.br +# com acesso a read_stream +# acessar https://developers.facebook.com/tools/explorer/ e Clicar no botão "Obter token de acesso" +# selecionar na aba Extended Permissions "read_stream" +#https://graph.facebook.com/me/feed?method=GET&format=json&suppress_http_code=1&access_token=ACCESS_TOKEN + +# imagem do usuário que postou: +# http://graph.facebook.com/517267866/picture?type=small +# http://graph.facebook.com/517267866/picture?type=normal +# http://graph.facebook.com/517267866/picture?type=large +# http://graph.facebook.com/517267866/picture?type=square diff --git a/twitter-stream-listener/vendor/cache/addressable-2.3.6.gem b/twitter-stream-listener/vendor/cache/addressable-2.3.6.gem new file mode 100644 index 0000000..254dec8 Binary files /dev/null and b/twitter-stream-listener/vendor/cache/addressable-2.3.6.gem differ diff --git a/twitter-stream-listener/vendor/cache/atomic-1.1.16.gem b/twitter-stream-listener/vendor/cache/atomic-1.1.16.gem new file mode 100644 index 0000000..b77515a Binary files /dev/null and b/twitter-stream-listener/vendor/cache/atomic-1.1.16.gem differ diff --git a/twitter-stream-listener/vendor/cache/buftok-0.2.0.gem b/twitter-stream-listener/vendor/cache/buftok-0.2.0.gem new file mode 100644 index 0000000..2c3d94b Binary files /dev/null and b/twitter-stream-listener/vendor/cache/buftok-0.2.0.gem differ diff --git a/twitter-stream-listener/vendor/cache/equalizer-0.0.9.gem b/twitter-stream-listener/vendor/cache/equalizer-0.0.9.gem new file mode 100644 index 0000000..2072c17 Binary files /dev/null and b/twitter-stream-listener/vendor/cache/equalizer-0.0.9.gem differ diff --git a/twitter-stream-listener/vendor/cache/faraday-0.9.0.gem b/twitter-stream-listener/vendor/cache/faraday-0.9.0.gem new file mode 100644 index 0000000..0b00e52 Binary files /dev/null and b/twitter-stream-listener/vendor/cache/faraday-0.9.0.gem differ diff --git a/twitter-stream-listener/vendor/cache/http-0.5.0.gem b/twitter-stream-listener/vendor/cache/http-0.5.0.gem new file mode 100644 index 0000000..be46d7f Binary files /dev/null and b/twitter-stream-listener/vendor/cache/http-0.5.0.gem differ diff --git a/twitter-stream-listener/vendor/cache/http_parser.rb-0.6.0.gem b/twitter-stream-listener/vendor/cache/http_parser.rb-0.6.0.gem new file mode 100644 index 0000000..3d3d508 Binary files /dev/null and b/twitter-stream-listener/vendor/cache/http_parser.rb-0.6.0.gem differ diff --git a/twitter-stream-listener/vendor/cache/json-1.8.1.gem b/twitter-stream-listener/vendor/cache/json-1.8.1.gem new file mode 100644 index 0000000..d903086 Binary files /dev/null and b/twitter-stream-listener/vendor/cache/json-1.8.1.gem differ diff --git a/twitter-stream-listener/vendor/cache/memoizable-0.4.2.gem b/twitter-stream-listener/vendor/cache/memoizable-0.4.2.gem new file mode 100644 index 0000000..41d1f5b Binary files /dev/null and b/twitter-stream-listener/vendor/cache/memoizable-0.4.2.gem differ diff --git a/twitter-stream-listener/vendor/cache/multipart-post-2.0.0.gem b/twitter-stream-listener/vendor/cache/multipart-post-2.0.0.gem new file mode 100644 index 0000000..abfff3d Binary files /dev/null and b/twitter-stream-listener/vendor/cache/multipart-post-2.0.0.gem differ diff --git a/twitter-stream-listener/vendor/cache/naught-1.0.0.gem b/twitter-stream-listener/vendor/cache/naught-1.0.0.gem new file mode 100644 index 0000000..f59502d Binary files /dev/null and b/twitter-stream-listener/vendor/cache/naught-1.0.0.gem differ diff --git a/twitter-stream-listener/vendor/cache/simple_oauth-0.2.0.gem b/twitter-stream-listener/vendor/cache/simple_oauth-0.2.0.gem new file mode 100644 index 0000000..5901361 Binary files /dev/null and b/twitter-stream-listener/vendor/cache/simple_oauth-0.2.0.gem differ diff --git a/twitter-stream-listener/vendor/cache/thread_safe-0.3.1.gem b/twitter-stream-listener/vendor/cache/thread_safe-0.3.1.gem new file mode 100644 index 0000000..31b6ff5 Binary files /dev/null and b/twitter-stream-listener/vendor/cache/thread_safe-0.3.1.gem differ diff --git a/twitter-stream-listener/vendor/cache/twitter-5.8.0.gem b/twitter-stream-listener/vendor/cache/twitter-5.8.0.gem new file mode 100644 index 0000000..585278c Binary files /dev/null and b/twitter-stream-listener/vendor/cache/twitter-5.8.0.gem differ -- libgit2 0.21.2