m.reply "search for #{search} failed"
return
end
- doc = Document.new xml
+ doc = nil
+ begin
+ doc = Document.new xml
+ rescue
+ debug xml
+ error $!
+ end
unless doc
m.reply "search for #{search} failed"
return
m.reply reply
}
end
-
+
def freshmeat(m, params)
max = params[:limit].to_i
max = 8 if max > 8
begin
- xml = @bot.httputil.get('http://images.feedstermedia.com/feedcache/ostg/freshmeat/fm-releases-global.xml')
+ xml = @bot.httputil.get('http://freshmeat.net/backend/fm-releases-global.xml')
unless xml
m.reply "freshmeat news parse failed"
return
title_width = 0
done = 0
doc.elements.each("*/channel/item") {|e|
- desc = e.elements["description"].text
- title = e.elements["title"].text
+ desc = e.elements["description"].text.ircify_html
+ title = e.elements["title"].text.ircify_html
#title.gsub!(/\s+\(.*\)\s*$/, "")
title.strip!
title_width = title.length if title.length > title_width
plugin = FreshmeatPlugin.new
plugin.map 'freshmeat search :limit *search', :action => 'search_freshmeat',
:defaults => {:limit => 4}, :requirements => {:limit => /^\d+$/}
-plugin.map 'freshmeat :limit', :defaults => {:limit => 4},
+plugin.map 'freshmeat :limit', :defaults => {:limit => 4},
:requirements => {:limit => /^\d+$/}