]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
twitter plugin: CGI.escape, not URI.escape (thanks hlb)
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 14 Sep 2007 21:56:20 +0000 (21:56 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Fri, 14 Sep 2007 21:56:20 +0000 (21:56 +0000)
data/rbot/plugins/twitter.rb

index d1c6bd69dba3211ecb95a6ff88bd09b04dfec031..f04ca6735f5cd6f602a5c302a427a048f9ccb112 100644 (file)
@@ -12,6 +12,7 @@
 # twitter whenever
 
 require 'rexml/rexml'
+require 'cgi'
 
 class TwitterPlugin < Plugin
   def initialize
@@ -86,7 +87,7 @@ class TwitterPlugin < Plugin
       
     uri = "http://#{URI.escape(@registry[m.sourcenick + "_username"])}:#{URI.escape(@registry[m.sourcenick + "_password"])}@twitter.com/statuses/update.xml"
     
-    response = @bot.httputil.post(uri, "status=#{URI.escape(params[:status].to_s)}")
+    response = @bot.httputil.post(uri, "status=#{CGI.escape(params[:status].to_s)}")
     debug response
     
     if response.class == Net::HTTPOK