diff options
author | Matthias -apoc- Hecker <apoc@sixserv.org> | 2011-02-14 21:49:32 +0100 |
---|---|---|
committer | Matthias -apoc- Hecker <apoc@sixserv.org> | 2011-02-14 21:49:32 +0100 |
commit | 7842b4d2dbc2940fa19dc7da1f33980b236fb55a (patch) | |
tree | e954ed4c50ff775dd976c95da60dcf615a611d5a /data | |
parent | 3cbc6c46764b6dab92ca6ac92adf9d3fe46eddff (diff) |
twitter plugin: change the api urls to receive RTs
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/twitter.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/data/rbot/plugins/twitter.rb b/data/rbot/plugins/twitter.rb index 2ce8142f..e4c228da 100644 --- a/data/rbot/plugins/twitter.rb +++ b/data/rbot/plugins/twitter.rb @@ -92,18 +92,15 @@ class TwitterPlugin < Plugin count = friends ? @bot.config['twitter.friends_status_count'] : @bot.config['twitter.status_count'] user = URI.escape(nick) + # receive the public timeline per default (this works even without an access_token) + uri = "https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=#{user}&count=#{count}&include_rts=true" if @has_oauth and @registry.has_key?(m.sourcenick + "_access_token") if friends #no change to count variable - uri = "https://api.twitter.com/1/statuses/friends_timeline.xml?count=#{count}" - response = @access_token.get(uri).body - else - uri = "https://api.twitter.com/1/statuses/user_timeline.xml?screen_name=#{user}&count=#{count}" - response = @access_token.get(uri).body + uri = "https://api.twitter.com/1/statuses/friends_timeline.xml?count=#{count}&include_rts=true" end + response = @access_token.get(uri).body else - #unauthorized user, will try to get from public timeline the old way - uri = "http://twitter.com/statuses/user_timeline/#{user}.xml?count=#{count}" response = @bot.httputil.get(uri, :cache => false) end debug response |