]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/rss.rb
Move extensions to standard classes into a specific extends.rb util module
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / rss.rb
index 22a6dc18884b78f8c2236b712c586e216f961256..acebda9cc0d030d48afee4ea63c7fda2dac8c13a 100644 (file)
@@ -19,12 +19,6 @@ require 'rss/dublincore'
 #   warning "Unable to load RSS libraries, RSS plugin functionality crippled"\r
 # end\r
 \r
-class ::String\r
-  def riphtml\r
-    self.gsub(/<[^>]+>/, '').gsub(/&amp;/,'&').gsub(/&quot;/,'"').gsub(/&lt;/,'<').gsub(/&gt;/,'>').gsub(/&ellip;/,'...').gsub(/&apos;/, "'").gsub("\n",'')\r
-  end\r
-end\r
-\r
 class ::RssBlob\r
   attr_accessor :url\r
   attr_accessor :handle\r
@@ -341,7 +335,10 @@ class RSSFeedsPlugin < Plugin
   def change_rss(m, params)\r
     handle = params[:handle].downcase\r
     feed = @feeds.fetch(handle, nil)\r
-    return m.reply "No such feed with handle #{handle}" unless feed\r
+    unless feed\r
+      m.reply "No such feed with handle #{handle}"\r
+      return\r
+    end\r
     case params[:what].intern\r
     when :handle\r
       new = params[:new].downcase\r