Skip to content

Commit 9dd3387

Browse files
committed
don't use dc:creator for author, use author for dc:creator
1 parent 912589d commit 9dd3387

File tree

6 files changed

+19
-86
lines changed

6 files changed

+19
-86
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Check out the full output format in [test/output/reddit.json](test/output/reddit
2121
##### Notes:
2222
* The `dc:` prefix will be removed from all fields
2323
* Both `dc:date` and `pubDate` will be available in ISO 8601 format as `isoDate`
24+
* If `author` is specified, but not `dc:creator`, `creator` will be set to `author`
2425

2526
### NodeJS
2627
```js

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var HTTPS = require('https');
99
var Parser = module.exports = {};
1010

1111
var FEED_FIELDS = [
12+
['author', 'creator'],
1213
['dc:publisher', 'publisher'],
1314
['dc:creator', 'creator'],
1415
['dc:source', 'source'],
@@ -32,8 +33,8 @@ var PODCAST_FEED_FIELDS = ([
3233
]).map(f => ['itunes:' + f, f]);
3334

3435
var ITEM_FIELDS = [
36+
['author', 'creator'],
3537
['dc:creator', 'creator'],
36-
['dc:creator', 'author'],
3738
['dc:date', 'date'],
3839
['dc:language', 'language'],
3940
['dc:rights', 'rights'],

test/output/customfields.json

+15-15
Large diffs are not rendered by default.

test/output/instant-article.json

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"entries": [
44
{
55
"creator": "tobi",
6-
"author": "tobi",
76
"date": "2016-05-04T06:53:45Z",
87
"title": "My first Instant Article",
98
"link": "https://localhost:8000",

test/output/narro.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"feed": {
33
"entries": [
44
{
5+
"creator": "foobar@gmail.com",
56
"title": "FAQ for Narro",
67
"link": "https://www.narro.co/article/54e703933058540300000069",
78
"pubDate": "Fri, 20 Feb 2015 09:51:15 UTC",

0 commit comments

Comments
 (0)