Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Use feedr to fetch the data from a remote url, respect its caching, and parse its data. Despite its name, it's not just for feed data but also for all data that you can feed into it (including binary data).
CoffeeScript
Failed to load latest commit information.
src v2.12.0. Better YAML parser.
test v2.10.4. Improvement.
.editorconfig Add .editorconfig (v1.3.18 from bevry/base)
.gitignore
.jshintrc v2.9.1 August 3, 2014
.npmignore v2.10.4. Improvement.
.travis.yml v2.11.1. Updated dependencies.
CONTRIBUTING.md v2.11.1. Updated dependencies.
Cakefile Updated deps
HISTORY.md v2.12.0. Better YAML parser.
LICENSE.md v2.11.1. Updated dependencies.
README.md v2.11.1. Updated dependencies.
coffeelint.json v2.9.1 August 3, 2014
package.json v2.12.0. Better YAML parser.

README.md

Feedr

Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Gratipay donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

Use feedr to fetch the data from a remote url, respect its caching, and parse its data. Despite its name, it's not just for feed data but also for all data that you can feed into it (including binary data).

Install

NPM

  • Use: require('feedr')
  • Install: npm install --save feedr

Usage

// Prepare
var Feedr, feedr, feeds

// Create a new feedr instance
feedr = require('feedr').create({/* optional configuration */})

// Prepare our feeds that we want read
feeds = {
    github: "https://github.com/bevry/feedr/commits/master.atom",
    gittip: "https://www.gittip.com/balupton/public.json"
}

// Read a single feed
feedr.readFeed(feeds.github, {/* optional configuration */}, function(err, data, headers){
    console.log(err, data, headers)
})

// Read all the feeds together
feedr.readFeeds(feeds, {/* optional configuration */}, function(err, result){
    console.log(err, result.github, result.twitter)
})

Configuration

Feed configuration defaults / global configuration properties are:

  • log defaults to null, log function to use
  • tmpPath defaults to system tmp path, the tempory path to cache our feedr results to
  • cache defaults to one day 1000*60*60*24, available values:
    • Number prefers to use the cache when it is within the range of the number in milliseconds
    • true prefers to use the cache when the response headers indicate that the cache is still valid
    • "preferred" will always use the cache if the cache exists
    • false will never use the cache
  • xml2jsOptions defaults to null, the options to send to xml2js
  • requestOptions defaults to null, the options to send to request

Feed configuration properties are:

  • url required, the url to fetch
  • hash defaults to hash of the url, the hashed url for caching
  • name defaults to hash, the name of the feed for use in debugging
  • path defaults to tmp feed path, the path to save the file to
  • parse defaults to true, whether or not we should attempt to parse the response data, supported values are xml, json, cson, yaml, string, raw/false. If true will try all the available parsers. Can also be a function with the signature ({response, data, feed, feedr}, next(err, data))
  • check defaults to true, whether or not we should check the response data for custom error messages. Can also be a function with the signature ({response, data, feed, feedr}, next(err))
  • xml2jsOptions defaults to global value, the options to send to xml2js
  • requestOptions defaults to global value, the options to send to request

History

Discover the change history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Gratipay donate button Flattr donate button PayPayl donate button BitCoin donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Unless stated otherwise all works are:

and licensed under:

Something went wrong with that request. Please try again.