require 'open-uri' require 'rss/2.0' class Earthquake < Chokan::PluginBase def description 'none' end def on_privmsg(prefix, ch, msg) case msg when 'ゆれた' rss = open('http://weather.goo.ne.jp/earthquake/index.rdf') { |f| RSS::Parser.parse(f.read, false) } notice(ch, rss.items[0].title.sub(' - goo 天気', '')) end end end