From 89f4030384df7751cbee4dc9f5c279584a297dfa Mon Sep 17 00:00:00 2001 From: newsitunes Date: Wed, 23 Dec 2015 22:17:45 -0200 Subject: [PATCH] bot.rb --- bot.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 bot.rb diff --git a/bot.rb b/bot.rb new file mode 100644 index 0000000..6dd4d41 --- /dev/null +++ b/bot.rb @@ -0,0 +1,23 @@ +require "rubygems" +require "tweetstream" +require "em-http-request" +require "simple_oauth" +require "json" +require "uri" + +# config oauth +OAUTH = { + :consumer_key => "OS6MREf1fcR5UmrPw6Hp9Au3n", + :consumer_secret => "I1hw1oaW12WoFcbhqlGppgf1kntVjtsKVhU2lXZDZ1PasyJwcL", + :token => "4352322015-jjZxRRZagXmT0SVwmAEjMvXzaMHzXvl40VUk0SA", + :token_secret => "rUz0WpD81xJKzgNGxpcxApTCCYny4No3hokZR0pdJMDXG" +} +ACCOUNT_ID = OAUTH[4352322015].split("-").first.to_i + +TweetStream.configure do |config| + config.consumer_key = OAUTH[:consumer_key] + config.consumer_secret = OAUTH[:consumer_secret] + config.oauth_token = OAUTH[:token] + config.oauth_token_secret = OAUTH[:token_secret] + config.auth_method = :oauth +end