feedhandler
An extensible RSS/RDF/Atom feed parser for use with html-parser2.
Example
Assuming the following RSS, with a custom my:tag
you want to extract into your object model
Liftoff News http://liftoff.msfc.nasa.gov/ Liftoff to Space Exploration. en-us Tue, 10 Jun 2003 04:00:00 GMT Tue, 10 Jun 2003 09:41:01 GMT Star City http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's <a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm">Star City</a>. Tue, 03 Jun 2003 09:39:21 GMT http://liftoff.msfc.nasa.gov/2003/06/03.html#item573 <!-- custom extension to RSS payload --> So glad I could sneak this new content in
You can extract the value of the custom tag using the extensions
property.
var htmlparser2 = ;var FeedHandler = ; { var handler = cb extensions: input: "my:tag" output: "my_tag" ; try handler xmlMode: true; catch ex ; } moduleexports = parse;
Running parse
against the xml sample will return the following object: