From 852609ae698aafb5970d780518cdc016da87cabb Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Wed, 7 Jan 2009 01:17:23 +0100 Subject: twitter: auth when checking friends timeline Fixes issue #20. --- data/rbot/plugins/twitter.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/data/rbot/plugins/twitter.rb b/data/rbot/plugins/twitter.rb index a5ca23f8..94a1374e 100644 --- a/data/rbot/plugins/twitter.rb +++ b/data/rbot/plugins/twitter.rb @@ -62,7 +62,14 @@ class TwitterPlugin < Plugin uri = "http://twitter.com/statuses/user_timeline/#{user}.xml?count=#{count}" else count = @bot.config['twitter.friends_status_count'] - uri = "http://twitter.com/statuses/friends_timeline/#{user}.xml" + auth = "" + if m.private? + auth << URI.escape(@registry[m.sourcenick + "_username"]) + auth << ":" + auth << URI.escape(@registry[m.sourcenick + "_password"]) + auth << "@" + end + uri = "http://#{auth}twitter.com/statuses/friends_timeline/#{user}.xml" end response = @bot.httputil.get(uri, :headers => @header, :cache => false) -- cgit v1.2.3