diff options
-rw-r--r-- | data/rbot/plugins/twitter.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/data/rbot/plugins/twitter.rb b/data/rbot/plugins/twitter.rb index daa237c0..79d46619 100644 --- a/data/rbot/plugins/twitter.rb +++ b/data/rbot/plugins/twitter.rb @@ -15,6 +15,10 @@ require 'rexml/rexml' require 'cgi' class TwitterPlugin < Plugin + Config.register Config::IntegerValue.new('twitter.status_count', + :default => 1, :validate => Proc.new { |v| v > 0 && v <= 10}, + :desc => "Maximum number of status updates shown by 'twitter status'") + def initialize super @@ -49,8 +53,8 @@ class TwitterPlugin < Plugin user = URI.escape(nick) - # TODO configurable count - uri = "http://twitter.com/statuses/user_timeline/#{user}.xml?count=3" + count = @bot.config['twitter.status_count'] + uri = "http://twitter.com/statuses/user_timeline/#{user}.xml?count=#{count}" response = @bot.httputil.get(uri, :headers => @header, :cache => false) debug response |