React Native compatible package to parse RSS feeds
npm install @yamatsum/react-native-rss-parser

Parse RSS data into a simple object structure. Currently supports;
* RSS 2.0 specification
* Atom 1.0 specification
* Itunes elements for both RSS 2.0 and Atom 1.0 feeds
``sh`
npm install react-native-rss-parser --save
`js
import * as rssParser from 'react-native-rss-parser';
return fetch('http://www.nasa.gov/rss/dyn/breaking_news.rss')
.then((response) => response.text())
.then((responseData) => rssParser.parse(responseData))
.then((rss) => {
console.log(rss.title);
console.log(rss.items.length);
});
`
`jsrss-v2
{
type: undefined, // either or atom-v1en-us
title: undefined, // title of the channel
links: [{
url: undefined, // url of the channel
rel: undefined // type of url (eg. alternate)
}],
description: undefined, // description of the channel
language: undefined, // language of the channel in yes
copyright: undefined, // copyright information about the channel
authors: [{
name: undefined // channel author names
}],
lastUpdated: undefined, // last updated date for the channel
lastPublished: undefined, // last published date for the channel
categories: [{
name: undefined // categories the channel belong too
}],
image: {
url: undefined, // channel image url
title: undefined, // channel image title
description: undefined, // channel image description
width: undefined, // channel image width (pixels)
height: undefined // channel image height (pixels)
},
itunes: { // itunes specific channel information
author: [{
name: undefined // channel author names
}],
block: undefined, // if then the entire podcast isn't shown in iTunes directoryyes
categories: [{
name: undefined, // channel category names
subCategories:[{
name: undefined // sub category names
}]
}],
image: undefined, // channel image url
explicit: undefined, // /no to indicate if channel contains explicit contentyes
complete: undefined, // indicates the feed won't publish any new items in the futureyes
newFeedUrl: undefined, // a url pointing to the new feed location
owner: {
name: undefined, // owner name of the channel
email: undefined, // owner email address of the channel
},
subtitle: undefined, // sub title of the channel
summary: undefined, // summary of the channel
},
items: [{ // list of items in the feed
id: undefined, // item id
title: undefined, // item title
imageUrl: undefined, // item image url
links: [{
url: undefined, // item link url
rel: undefined // type of item link
}],
description: undefined, // item description
content: undefined, // item HTML content
categories: [{
name: undefined // categories the item belongs too
}],
authors: [{
name: undefined // item author names
}],
published: undefined, // item published date
enclosures: [{
url: undefined, // item media url
length: undefined, // item media length (bytes)
mimeType: undefined // item media mime type (eg audio/mpeg)
}],
itunes: { // itunes specific item information
authors: [{
name: undefined, // item author names
}],
block: undefined, // indicates the item won't be displayed in the iTunes directoryyes
duration: undefined, // HH:MM:SS length of the item
explicit: undefined, // /no to indicate if item contains explicit contentyes
image: undefined, // image url for the item
isClosedCaptioned: undefined, // indicates if the item contains closed captioning`
order: undefined, // item order number
subtitle: undefined, // item subtitle
summary: undefined, // item summary
}
}]
}
| Parsed Value | RSS v2.0 | Atom v1.0 |
| ------------- | ------------- | ------------- |
| title | title | title |
| links | link | link |
| description | description | subtitle |
| language | language | |
| copyright | copyright | rights |
| authors | managingEditor| author |
| published | pubDate | published |
| updated | lastBuildDate | updated |
| categories | category | category |
| image | image | logo |
| items | item | entry |
| Parsed Value | RSS v2.0 | Atom v1.0 |
| ------------- | --------------- | ------------- |
| id | guid | id |
| title | title | title |
| imageUrl | | icon |
| links | link | link |
| description | description | summary |
| content | content:encoded | content |
| categories | category / dc:subject| category |
| authors | author / dc:creator | contributor |
| published | pubDate / dc:date | published |
| enclosures | enclosures | link |
Clone this project from GitHub
`sh`
npm install
npm test
If you find any bugs or have a feature request, please create an issue in GitHub.
1. Fork it (
2. Create your feature branch (git checkout -b feature/fooBar)git commit -am 'Add some fooBar'
3. Commit your changes ()git push origin feature/fooBar
4. Push to the branch ()
5. Create a new Pull Request
Distributed under the MIT license. See LICENSE` for more information.