4 ms·
Thanks Peter! I was looking into FeedTools... http://sporkmonger.com/2008/2/1/feedtools-0-2-27 http://sporkmonger.com/2008/2/1/feedtools-0-2-27 But I'll proba
by ridertech 18y ago
Thanks Peter! I was looking into FeedTools...
http://sporkmonger.com/2008/2/1/feedtools-0-2-27 http://sporkmonger.com/2008/2/1/feedtools-0-2-27
But I'll probably just build something custom w/ Ruby. I was hoping someone else had already done the work and open sourced it ;)
- petercooper 18y agoUnfortunately I'm unable to share the code, as I sold the intellectual property. However, I can share that it used Hpricot, and had a number of XPath rules for each discrete element of both the general feed and "items" that needed to be extracted (title, link, description, time, etc). Each rule was in an array, so rules for Atom and RSS could be mixed.. the first to match dictated the format. This is a pretty quick and dirty (but ever so effective) way of doing it - parsing feeds as XML in the "technically correct" way is an absolute nightmare given the poor validity of XML out there ;-) All that said, one thing worth looking at is: http://rfeedparser.rubyforge.org/ http://rfeedparser.rubyforge.org/ - it's based on the Python Universal Feed Parser which is generally considered to be the most awesome of feed parsers out there :)
- ridertech 18y agorfeedparser looks perfect, but i'm in dependency hell... Gem::Exception (can't activate hpricot (= 0.6), already activated hpricot-0.6.164])
- petercooper 18y agoEither force install Hpricot 0.6 (your usual stuff will still use the newer one, rfeedparser will use 0.6) or go mangle with rfeedparser to remove the lock to that version (of course, that removes any guarantee of it working 100%). BTW, today is an awesome day to write a new feed parser. Here's why: http://www.rubyinside.com/nokogiri-ruby-html-parser-and-xml-parser-1288.html http://www.rubyinside.com/nokogiri-ruby-html-parser-and-xml-...