X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Ffreshmeat.rb;h=49e73e0d2785b447ecef4237240c048765c548db;hb=43475d2d90769a06df3b6b583683cfd474f6547e;hp=eb2dbdf7e0dafd6f700c756ff0d86cf22e644a3f;hpb=8b0e2e09f81a7d89ceb52e947e9db12a206a8c37;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/freshmeat.rb b/data/rbot/plugins/freshmeat.rb index eb2dbdf7..49e73e0d 100644 --- a/data/rbot/plugins/freshmeat.rb +++ b/data/rbot/plugins/freshmeat.rb @@ -1,5 +1,4 @@ require 'rexml/document' -require 'uri/common' class FreshmeatPlugin < Plugin include REXML @@ -11,12 +10,7 @@ class FreshmeatPlugin < Plugin max = params[:limit].to_i search = params[:search].to_s max = 8 if max > 8 - begin - xml = @bot.httputil.get(URI.parse("http://freshmeat.net/search-xml/?orderby=locate_projectname_full_DESC&q=#{URI.escape(search)}")) - rescue URI::InvalidURIError, URI::BadURIError => e - m.reply "illegal search string #{search}" - return - end + xml = @bot.httputil.get("http://freshmeat.net/search-xml/?orderby=locate_projectname_full_DESC&q=#{CGI.escape(search)}") unless xml m.reply "search for #{search} failed" return @@ -59,7 +53,7 @@ class FreshmeatPlugin < Plugin max = params[:limit].to_i max = 8 if max > 8 begin - xml = @bot.httputil.get(URI.parse("http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml")) + xml = @bot.httputil.get('http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml') unless xml m.reply "freshmeat news parse failed" return