Giter Site home page Giter Site logo

feeder's Introduction

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.

ToDo

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

feeder's People

Contributors

ayyron-lmao avatar littlebrown avatar nicolacronycle avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.