1.0.7-b • Published 9 years ago

get-rss-atom v1.0.7-b

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

Simple RSS/ATOM feed parser.

getRssAtom(url, callback) returns a callback with an object:

{
    title: String,
    href: String,
    items: Array [
        {
            title: String,
            content: String,
            href: String
        },
        ...
    ]
}

Install

npm install --save get-rss-atom

Usage

An example reader:

mkdir reader
cd reader
npm init -y
npm install --save get-rss-atom

Create reader.js

'use strict';

const reader = require('get-rss-atom');

let
    count = 0,
    feedUrl = '';

if (process.argv.length > 2) {
    feedUrl = process.argv[2]
} else {
    console.error('Please specify an RSS URL.');
    process.exit(1)
}

reader.getRssAtom(feedUrl, feed => {
    console.log(`\n${feed.title} (${feed.href})\n`);
    feed.items.forEach((item) => {
        count++;
        console.log(`\n--${count}-- ${item.title}\n${item.content}\n${item.href}\n`)
    })
});

Run:

node reader http://www.at5.nl/feeds/at5/nieuws/V100/nieuws
1.0.7-b

9 years ago

1.0.7-a

9 years ago

1.0.7

9 years ago

1.0.6-j

9 years ago

1.0.6-k

9 years ago

1.0.6-i

9 years ago

1.0.6-g

9 years ago

1.0.6-f

9 years ago

1.0.6-e

9 years ago

1.0.6-d

9 years ago

1.0.6-c

9 years ago

1.0.6-b

9 years ago

1.0.6-a

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3-j

9 years ago

1.0.3-i

9 years ago

1.0.3-h

9 years ago

1.0.3-g

9 years ago

1.0.3-f

9 years ago

1.0.3-e

9 years ago

1.0.3-d

9 years ago

1.0.3-c

9 years ago

1.0.3-b

9 years ago

1.0.3-a

9 years ago

1.0.3

9 years ago

1.0.2-d

9 years ago

1.0.2-c

9 years ago

1.0.2-b

9 years ago

1.0.2-a

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago