1.0.1 • Published 10 years ago
node-feedparser v1.0.1
feedparser
This module depends on https://github.com/danmactough/node-feedparser No need to care about stream, Just use xml feed content
Install
npm install node-feedparserUsage
request = require('request')
parser = require('node-feedparser')
request 'http://www.u148.net/rss/', (error, resp, body)->
parser body, (error, ret)->
console.log(error)
console.log(ret)API
parser(xmlContent, options, callback)
xmlContent is String rss,feed,rdf xml content
options is Object or Function if Object options.siteTags Array select site tags options itemTags Array select article tags if Function callback
callback is Function callback Error, {site,items}
List of meta properties
- title
- description
- link (website link)
- xmlurl (the canonical link to the feed, as specified by the feed)
- date (most recent update)
- pubdate (original published date)
- author
- language
- image (an Object containing
urlandtitleproperties) - favicon (a link to the favicon -- only provided by Atom feeds)
- copyright
- generator
- categories (an Array of Strings)
List of article properties
- title
- description (frequently, the full article content)
- summary (frequently, an excerpt of the article content)
- link
- origlink (when FeedBurner or Pheedo puts a special tracking url in the
linkproperty,origlinkcontains the original link) - permalink (when an RSS feed has a
guidfield and theisPermalinkattribute is not set tofalse,permalinkcontains the value ofguid) - date (most recent update)
- pubdate (original published date)
- author
- guid (a unique identifier for the article)
- comments (a link to the article's comments section)
- image (an Object containing
urlandtitleproperties) - categories (an Array of Strings)
- source (an Object containing
urlandtitleproperties pointing to the original source for an article; see the RSS Spec for an explanation of this element) - enclosures (an Array of Objects, each representing a podcast or other enclosure and having a
urlproperty and possiblytypeandlengthproperties) - meta (an Object containing all the feed meta properties; especially handy when using the EventEmitter interface to listen to
articleemissions)
1.0.1
10 years ago