A lax Web news feed parser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
1.5 KiB

# These tests validate that format mixing works, where it is particularly relevant
# It is assumed these tests will not be exhaustive
Atom related link in RSS 2.0: # A reliable related link overrides the RSS 2.0 guessing game
input: >
<rss><channel xmlns:atom="http://www.w3.org/2005/Atom">
<item>
<guid>http://example.com/</guid>
<link>http://example.org/</link>
<atom:link rel="related" href="http://example.net/"/>
</item>
</channel></rss>
output:
format: rss
entries:
- id: 'http://example.com/'
link: 'http://example.org/'
relatedLink: 'http://example.net/'
Update and creation dates:
input: >
<rss><channel xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<item>
<pubDate>2020-03-03T00:00:00Z</pubDate>
</item>
<item>
<atom:published>2020-03-03T00:00:00Z</atom:published>
<lastBuildDate>2020-01-01T00:00:00Z</lastBuildDate>
</item>
<item>
<dc:date>2020-03-03T01:00:00+01:00</dc:date>
<pubDate>2020-03-03T00:00:00Z</pubDate>
</item>
</channel></rss>
output:
format: rss
entries:
- dateModified: '2020-03-03T00:00:00Z'
- dateCreated: '2020-03-03T00:00:00Z'
dateModified: '2020-01-01T00:00:00Z'
- dateModified: '2020-03-03T01:00:00+01:00'