From: Giuseppe Bilotta Date: Fri, 14 Sep 2007 21:56:20 +0000 (+0000) Subject: twitter plugin: CGI.escape, not URI.escape (thanks hlb) X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=d611c8bfc1d1a240b30a6757229bcc3c8bb697db;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git twitter plugin: CGI.escape, not URI.escape (thanks hlb) --- diff --git a/data/rbot/plugins/twitter.rb b/data/rbot/plugins/twitter.rb index d1c6bd69..f04ca673 100644 --- a/data/rbot/plugins/twitter.rb +++ b/data/rbot/plugins/twitter.rb @@ -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