Giter Site home page Giter Site logo

alabeduarte / feedparser-promised Goto Github PK

View Code? Open in Web Editor NEW
40.0 1.0 5.0 750 KB

[DEPRECATED] Wrapper around feedparser with promises

License: MIT License

JavaScript 71.33% Shell 28.67%
promise feedparser article wrapper feed feeds parser promises rss

feedparser-promised's Introduction

[DEPRECATED] feedparser-promised

npm version downloads npm license travis build codeclimate score

โ›”๏ธ DEPRECATED

I've decided to deprecate this libary as feedparser already does a pretty good job to parse content from a RSS feed.

This repo, as a wrapper, will always get behind the newly features and security updates. If you used this library until now or have even considered, thank you and I'm sorry.

Wrapper around feedparser with promises.

Install

  $ npm install --save feedparser-promised

Usage

  const feedparser = require('feedparser-promised');

  const url = 'http://feeds.feedwrench.com/JavaScriptJabber.rss';

  feedparser.parse(url).then(items =>
    items.forEach(item => console.log('title:', item.title));
  ).catch(console.error);

Using HTTP Node.js options

const feedparser = require('feedparser-promised');

const httpOptions = {
  uri: 'http://feeds.feedwrench.com/JavaScriptJabber.rss',
  timeout: 3000,
  gzip: true,
  // ...
};

feedparser.parse(httpOptions).then(items => { /* do your magic here */ });

Using Feedparser options

const feedparser = require('feedparser-promised');

const httpOptions = {
  uri: 'http://feeds.feedwrench.com/JavaScriptJabber.rss',
  // ...
};

const feedparserOptions = {
  feedurl: 'http://feeds.feedwrench.com/JavaScriptJabber.rss',
  normalize: false,
  addmeta: false,
  resume_saxerror: true
};

feedparser.parse(httpOptions, feedparserOptions).then(items => { /* do your magic here */ });

List of article properties

  • title: title
  • description: frequently, the full article content
  • summary: frequently, an excerpt of the article content
  • link: link
  • origlink: when FeedBurner or Pheedo puts a special tracking url in the link property, origlink contains the original link
  • permalink: when an RSS feed has a guid field and the isPermalink attribute is not set to false, permalink contains the value of guid
  • date: most recent update
  • pubdate: original published date
  • author: author
  • guid a unique identifier for the article
  • comments: a link to the article's comments section
  • image: an Object containing urlandtitle` properties
  • categories: an Array of Strings
  • source: an Object containing url and title properties 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 url property and possibly type and length properties
  • meta: an Object containing all the feed meta properties; especially handy when using the EventEmitter interface to listen to article emissions

Contributing

There are many ways to contribute, such as fixing opened issues, creating them or suggesting new ideas. Either way will be very appreciated.

If there are issues open, I recommend you follow those steps:

  • Create a branch feedparser-promised#{issue_number}; eg: feedparser-promised#42
  • Please, remember to write unit tests.
  • Send a pull request!

Running Tests

$ npm test

License

feedparser-promised is released under the MIT License.

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.