feederjs
An RSS/Atom feed parser that converts RSS and Atom Feeds to a single object type.
Last updated 3 years ago by somners .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install feederjs 
SYNC missed versions from official npm registry.

Welcome to my first node module!

feederjs

feederjs is a small, simple to use Atom and RSS parser. It uses the fast and lightweight sax-js Sax parser to parse an Atom or RSS feed into a single JavaScript Object type that mimics the structure (but not exactly) of the Atom Specification.

What this is intended to be:
  • Simple to Implement
  • Simple to Use
What this is NOT intended to be:
  • A Robust feature Rich API
  • One stop library for all Atom/RSS needs

Examples

Install with: > npm install --save feederjs To retreive a feed is very simple. Let's examine the following code.

const feeder = require('feederjs');
feeder.getFeed('http://feeds.reuters.com/news/artsculture?format=xml', (feed) => { console.log(feed.title); });

would output

"Reuters: Arts"

Sometimes, we Err. If your passed url does not specify a protocol, or if the url does not lead to a feed or rss xml object. A FeederException will be thrown. To catch this, consider:

feeder.getFeed('https://google.com', (feed) => {
  if (feed instanceof feeder.FeederException){
    console.log('error: ' + feed.message);
  } else {
    console.log(feed.title);
  }
});

Pretty simple, right? While feederjs aims to be simple, this limits it's use cases. If you are looking for a parser that is more structured around the RSS Specification you might want to try feedparser. Or if you are looking for in depth parsing of the xml structure, you may want to look at sax-js.

Documentation

Documentation can be found Here.

License

MIT

Contributions

Pull and feature requests are welcome. Please use the linting rules in the eslint file. Please open an issue or comment on an existing one to outline your intent of the the Pull Request.

ToDo

  • Add support for reading from files and streams
  • Add support for returning Promises as well as objects.

Current Tags

  • 1.0.3                                ...           latest (3 years ago)

4 Versions

  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (1)
Dev Dependencies (7)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |