Skip to content

Commit

Permalink
Merge pull request #21 from ndaidong/v3.1.0
Browse files Browse the repository at this point in the history
v3.1.0
  • Loading branch information
ndaidong authored Nov 26, 2021
2 parents 3b28d2a + e5c8a25 commit 5618bd7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Parse RSS/ATOM data from given feed url.

[![NPM](https://badge.fury.io/js/feed-reader.svg)](https://badge.fury.io/js/feed-reader)
![CI test](https://github.com/ndaidong/feed-reader/workflows/ci-test/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/ndaidong/feed-reader/badge.svg)](https://coveralls.io/github/ndaidong/feed-reader)
[![Coverage Status](https://coveralls.io/repos/github/ndaidong/feed-reader/badge.svg?updated=1)](https://coveralls.io/github/ndaidong/feed-reader)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=ndaidong_feed-reader&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=ndaidong_feed-reader)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Expand Down Expand Up @@ -70,13 +70,13 @@ Example feed data:
"description": "Google News",
"generator": "NFE/5.0",
"language": "",
"updated": "Tue, Nov 23, 2021 05:58:17 PM",
"published": "Tue, Nov 23, 2021 05:58:17 PM",
"entries": [
{
"title": "Lone suspect in Waukesha parade crash to appear in court today, as Wisconsin reels from tragedy that left 5 dead and dozens more injured - CNN",
"link": "https://news.google.com/__i/rss/rd/articles/CBMiTmh0dHBzOi8vd3d3LmNubi5jb20vMjAyMS8xMS8yMy91cy93YXVrZXNoYS1jYXItcGFyYWRlLWNyb3dkLXR1ZXNkYXkvaW5kZXguaHRtbNIBUmh0dHBzOi8vYW1wLmNubi5jb20vY25uLzIwMjEvMTEvMjMvdXMvd2F1a2VzaGEtY2FyLXBhcmFkZS1jcm93ZC10dWVzZGF5L2luZGV4Lmh0bWw?oc=5",
"description": "Lone suspect in Waukesha parade crash to appear in court today, as Wisconsin reels from tragedy that left 5 dead and dozens more injured    CNN Waukesha Christmas parade attack: 5 dead, 48 injured, Darrell Brooks named as...",
"pubDate": "Tue, Nov 23, 2021 05:34:00 PM"
"published": "Tue, Nov 23, 2021 05:34:00 PM"
},
// ...
]
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export interface FeedData {
description?: string;
generator?: string;
language?: string;
updated?: date;
published?: date;
entries?: array;
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.0.2",
"version": "3.1.0",
"name": "feed-reader",
"description": "Parse ATOM/RSS data from given feed url",
"homepage": "https://www.npmjs.com/package/feed-reader",
Expand Down
4 changes: 2 additions & 2 deletions src/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const nock = require('nock')

const { parse } = require('./main')

const feedAttrs = 'title link description generator language updated entries'.split(' ')
const entryAttrs = 'title link description pubDate'.split(' ')
const feedAttrs = 'title link description generator language published entries'.split(' ')
const entryAttrs = 'title link description published'.split(' ')

const state = {}

Expand Down
8 changes: 4 additions & 4 deletions src/utils/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const nomalizeRssItem = (entry) => {
title: toText(entry.title),
link: purifyUrl(toLink(entry.link)),
description: toDesc(entry.description),
pubDate: toDate(toText(entry.pubDate))
published: toDate(toText(entry.pubDate))
}
}

Expand All @@ -62,7 +62,7 @@ const nomalizeAtomItem = (entry) => {
title: toText(entry.title),
link: purifyUrl(toLink(entry.link)),
description: toDesc(entry.summary || entry.description || entry.content),
pubDate: toDate(toText(entry.updated || entry.published))
published: toDate(toText(entry.updated || entry.published))
}
}

Expand All @@ -87,7 +87,7 @@ const parseRSS = (xmldata) => {
description,
generator,
language,
updated: toDate(lastBuildDate),
published: toDate(lastBuildDate),
entries
}
}
Expand All @@ -112,7 +112,7 @@ const parseAtom = (xmldata) => {
description: subtitle,
generator,
language,
updated: toDate(updated),
published: toDate(updated),
entries
}
}
Expand Down

0 comments on commit 5618bd7

Please sign in to comment.