I am trying to integrate a RSS parser into my IRC bot, and i've found some simple code to do so online, however, if i put this code in the bot, I get this:
Error: private method `send' called for #<RSS::REXMLListener:0x3d7c790>
I'm not sure why it gives me this error, as it works fine in IRB or in its own private script. This is the code, and the line thats causing the error.
def fetch_rss_items(url, max_items = nil)
%w{open-uri rss/0.9 rss/1.0 rss/2.0 rss/parser}.each do |lib|
require(lib)
end
rss = RSS::Parser.parse(open(url).read) #This line is causing the error
rss.items[0...(max_items ? max_items : rss.items.length)]
end