easy-feed
v1.0.7
Published
Easy-feed is a easy way to get RSS feed.
Downloads
2
Maintainers
Readme
easy-feed
Easy-feed is a easy way to get RSS feed.
- Get paginated feed
- Limit the number of results
- Search engine
Installation
$ npm install easy-feed
Examples
const easy = new Easy({
rss: [{ source: 'Wired', url: 'https://www.wired.com/feed/category/science/latest/rss' }],
category: 'Technology',
locale: 'en',
page: 0,
limit: 3
});
const feed = await easy.getFeed();
Output
console.log(feed)
[
{
"author": "Daniel Oberhaus",
"title": "What's Next for SpaceX's Crewed Mission to the ISS?",
"link": "https://www.wired.com/story/whats-next-for-spacexs-crewed-mission-to-the-iss",
"source": "Wired",
"publishAt": "2020-05-29T20:48:01.000Z",
"publishAtFormatted": "Friday, May 29, 2020 10:48 PM",
"categories": [
"Science",
"Science / Space"
],
"category": "Technology",
"thumbnail": {
"url": "https://media.wired.com/photos/5ed00ee09948303154121fc5/master/pass/Science_spacex_1227424013.jpg",
"type": ""
},
"content": "On Saturday, the company will take a second run at launching astronauts to the International Space Station. But only if a lot of things go right.",
"id": "79O110n3283S97a"
},
{
"author": "Daniel Oberhaus",
"title": "‘Oumuamua Might Be a Giant Interstellar Hydrogen Iceberg",
"link": "https://www.wired.com/story/oumuamua-might-be-a-giant-interstellar-hydrogen-iceberg",
"source": "Wired",
"publishAt": "2020-05-29T13:00:00.000Z",
"publishAtFormatted": "Friday, May 29, 2020 3:00 PM",
"categories": [
"Science",
"Science / Space"
],
"category": "Technology",
"thumbnail": {
"url": "https://media.wired.com/photos/5ed02ac2fbf7b2147038a89d/master/pass/Science_interstellerobject_1025375430.jpg",
"type": ""
},
"content": "It isn’t an alien spaceship, but new research suggests the first known interstellar object to grace our solar system could be something even stranger.",
"id": "73I116t32105i115s"
},
{
"author": "Gregory Barber",
"title": "Covid-19 Testing Is Expensive. It Doesn't Have to Be",
"link": "https://www.wired.com/story/covid-19-testing-is-expensive-it-doesnt-have-to-be",
"source": "Wired",
"publishAt": "2020-05-29T12:00:00.000Z",
"publishAtFormatted": "Friday, May 29, 2020 2:00 PM",
"categories": [
"Science",
"Science / Health"
],
"category": "Technology",
"thumbnail": {
"url": "https://media.wired.com/photos/5ed01423fbf7b2147038a89b/master/pass/Science_covidtest_488441202.jpg",
"type": ""
},
"content": "The diagnostics industry favors wealthy countries, but the rest of the world needs tests, too. Stanford bioengineer Manu Prakash thinks \"frugal science can help.",
"id": "84T104h101e32100d"
}
]
Options
const easy = new Easy(options);
- rss: (required) array of rss to get feed with two keys
- source : <string> source of you rss
- url:<string> url of your rss
- category : ( optional) <string> category of your feed
- locale : (optional 'en' by default) <string> language used in field publishAtFormatted response
- page : (optional 0 by default) <number>
- limit : (optional 50 by default) <number> limit of total results
- contentLength: (optional 40 by default) <number> total characters of content field
Contributing
Contributions are welcome!:
Running Tests
npm test
License
MIT