]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/grouphug.rb
autoop plugin: make the "add" command add arguments to existing settings
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / grouphug.rb
index 75093665067f7036d237e9f2d77ca01467d3adf0..15735b9f1a710065e7884717e7edfe753f273eaf 100644 (file)
@@ -13,10 +13,15 @@ class GrouphugPlugin < Plugin
   end
 
   def confess(m, params)
+    opts = { :cache => false }
     path = "random"
-    path = "confessions/#{params[:num]}" if params[:num]
+    if params[:num]
+      path = "confessions/#{params[:num]}"
+      opts.delete(:cache)
+    end
+
     begin
-      data = @bot.httputil.get_cached(URI.parse("http://grouphug.us/#{path}"))
+      data = @bot.httputil.get("http://grouphug.us/#{path}", opts)
 
       reg = Regexp.new( '(<td class="conf-text")(.*?)(<p>)(.*?)(</p>)', Regexp::MULTILINE )
       confession = reg.match( data )[4].ircify_html