@extractus/feed-extractor
Advanced tools
Comparing version 7.0.2 to 7.0.3
{ | ||
"version": "7.0.2", | ||
"version": "7.0.3", | ||
"name": "@extractus/feed-extractor", | ||
@@ -40,4 +40,4 @@ "description": "To read and normalize RSS/ATOM/JSON feed data", | ||
"https-proxy-agent": "^7.0.1", | ||
"jest": "^29.6.2", | ||
"nock": "^13.3.2" | ||
"jest": "^29.6.3", | ||
"nock": "^13.3.3" | ||
}, | ||
@@ -44,0 +44,0 @@ "keywords": [ |
@@ -215,2 +215,19 @@ // main.test | ||
}) | ||
test('extract rss feed from medium.com (content:encoded)', async () => { | ||
const url = 'https://medium.com/feed/@ameliakusiak' | ||
const xml = readFileSync('test-data/medium-feed.xml', 'utf8') | ||
const { baseUrl, path } = parseUrl(url) | ||
nock(baseUrl).get(path).reply(200, xml, { | ||
'Content-Type': 'application/xml', | ||
}) | ||
const result = await extract(url) | ||
feedAttrs.forEach((k) => { | ||
expect(hasProperty(result, k)).toBe(true) | ||
}) | ||
entryAttrs.forEach((k) => { | ||
expect(hasProperty(result.entries[0], k)).toBe(true) | ||
}) | ||
expect(validateProps(result.entries[0])).toBe(true) | ||
}) | ||
}) | ||
@@ -217,0 +234,0 @@ |
@@ -30,5 +30,7 @@ // parseRssFeed.js | ||
description = '', | ||
'content:encoded': content = '', | ||
} = item | ||
const published = useISODateFormat ? toISODateString(pubDate) : pubDate | ||
const htmlContent = getText(content || description) | ||
const entry = { | ||
@@ -39,3 +41,3 @@ id: getEntryId(guid, link, pubDate), | ||
published, | ||
description: buildDescription(description, descriptionMaxLen), | ||
description: buildDescription(htmlContent || description, descriptionMaxLen), | ||
} | ||
@@ -42,0 +44,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60033
1534