Skip to content

Commit cf8d076

Browse files
committed
update readme
1 parent 6f353af commit cf8d076

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

README.md

+30-9
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ You can parse RSS from a URL, local file (NodeJS only), or a string.
1616
* `parseFile(filename, [options,], callback)`
1717
* `parseURL(url, [options,] callback)`
1818

19-
20-
## Output
21-
Check out the full output format in [test/output/reddit.json](test/output/reddit.json)
22-
23-
##### Notes:
24-
* The `dc:` prefix will be removed from all fields
25-
* Both `dc:date` and `pubDate` will be available in ISO 8601 format as `isoDate`
26-
* If `author` is specified, but not `dc:creator`, `creator` will be set to `author` ([see article](http://www.lowter.com/blogs/2008/2/9/rss-dccreator-author))
27-
2819
### NodeJS
2920
```js
3021
var parser = require('rss-parser');
@@ -49,6 +40,36 @@ RSSParser.parseURL('https://www.reddit.com/.rss', function(err, parsed) {
4940
</script>
5041
```
5142

43+
## Output
44+
Check out the full output format in [test/output/reddit.json](test/output/reddit.json)
45+
46+
```yaml
47+
feed:
48+
feedUrl: 'https://www.reddit.com/.rss'
49+
title: 'reddit: the front page of the internet'
50+
description: ""
51+
link: 'https://www.reddit.com/'
52+
entries:
53+
- title: 'The water is too deep, so he improvises'
54+
link: 'https://www.reddit.com/r/funny/comments/3skxqc/the_water_is_too_deep_so_he_improvises/'
55+
pubDate: 'Thu, 12 Nov 2015 21:16:39 +0000'
56+
creator: "John Doe"
57+
content: '<a href="http://example.com">this is a link</a> - <b>this is bold text</b>'
58+
contentSnippet: 'this is a link - this is bold text'
59+
guid: 'https://www.reddit.com/r/funny/comments/3skxqc/the_water_is_too_deep_so_he_improvises/'
60+
categories:
61+
- funny
62+
isoDate: '2015-11-12T21:16:39.000Z'
63+
```
64+
65+
##### Notes:
66+
* The `contentSnippet` field strips out HTML tags and unescapes HTML entities
67+
* The `dc:` prefix will be removed from all fields
68+
* Both `dc:date` and `pubDate` will be available in ISO 8601 format as `isoDate`
69+
* If `author` is specified, but not `dc:creator`, `creator` will be set to `author` ([see article](http://www.lowter.com/blogs/2008/2/9/rss-dccreator-author))
70+
71+
## Options
72+
5273
### Redirects
5374
By default, `parseURL` will follow up to one redirect. You can change this
5475
with `options.maxRedirects`.

0 commit comments

Comments
 (0)