Skip to content

Commit 59cc76d

Browse files
committed
Add test case for podcast/iTunes RSS feed
1 parent d55dee0 commit 59cc76d

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

test/input/narro.rss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version="1.0" encoding="UTF-8"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>foobar on Narro</title><link>http://on.narro.co/f</link><description>foobar uses Narro to create a podcast of articles transcribed to audio.</description><language>en</language><copyright>All article content copyright of respective source authors.</copyright><managingEditor>foobar@gmail.com</managingEditor><webMaster>josh@narro.co</webMaster><pubDate>Fri, 08 Jul 2016 13:40:00 UTC</pubDate><generator>gopod - http://github.com/jbckmn/gopod</generator><ttl>20</ttl><itunes:author>foobar@gmail.com</itunes:author><itunes:subtitle>foobar uses Narro to create a podcast of articles transcribed to audio.</itunes:subtitle><itunes:summary>foobar uses Narro to create a podcast of articles transcribed to audio.</itunes:summary><itunes:explicit>no</itunes:explicit><itunes:owner><itunes:name>foobar</itunes:name><itunes:email>foobar@gmail.com</itunes:email></itunes:owner><itunes:image href="https://www.narro.co/images/narro-icon-lg.png"></itunes:image><atom:link href="http://on.narro.co/f" rel="self" type="application/rss+xml"></atom:link><item><link>https://www.narro.co/article/54e703933058540300000069</link><description>Listen to your reading list anywhere. Narro will take your bookmarked articles and read them back to you as a podcast.&lt;br/&gt; http://www.narro.co/faq&lt;br/&gt; &lt;ul class=&#34;linkList&#34;&gt;&lt;/ul&gt;</description><title>FAQ for Narro</title><pubDate>Fri, 20 Feb 2015 09:51:15 UTC</pubDate><author>foobar@gmail.com</author><guid>https://www.narro.co/article/54e703933058540300000069</guid><itunes:author>foobar@gmail.com</itunes:author><itunes:subtitle>FAQ for Narro</itunes:subtitle><itunes:summary>Listen to your reading list anywhere. Narro will take your bookmarked articles and read them back to you as a podcast. ... http://www.narro.co/faq ... &lt;ul class=&#34;linkList&#34;&gt;&lt;/ul&gt;</itunes:summary><itunes:explicit>no</itunes:explicit><itunes:duration>74</itunes:duration><enclosure url="https://s3.amazonaws.com/nareta-articles/audio/54d046c293f79c0300000003/7e2d2b00-a945-441a-f49b-063786a319a4.mp3" length="74" type="audio/mpeg"></enclosure></item></channel></rss>

test/output/narro.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"feed": {
3+
"entries": [
4+
{
5+
"title": "FAQ for Narro",
6+
"link": "https://www.narro.co/article/54e703933058540300000069",
7+
"pubDate": "Fri, 20 Feb 2015 09:51:15 UTC",
8+
"author": "foobar@gmail.com",
9+
"enclosure": {
10+
"url": "https://s3.amazonaws.com/nareta-articles/audio/54d046c293f79c0300000003/7e2d2b00-a945-441a-f49b-063786a319a4.mp3",
11+
"length": "74",
12+
"type": "audio/mpeg"
13+
},
14+
"content": "Listen to your reading list anywhere. Narro will take your bookmarked articles and read them back to you as a podcast.<br/> http://www.narro.co/faq<br/> <ul class=\"linkList\"></ul>",
15+
"contentSnippet": "Listen to your reading list anywhere. Narro will take your bookmarked articles and read them back to you as a podcast. http://www.narro.co/faq",
16+
"guid": "https://www.narro.co/article/54e703933058540300000069",
17+
"itunes": {
18+
"author": "foobar@gmail.com",
19+
"subtitle": "FAQ for Narro",
20+
"summary": "Listen to your reading list anywhere. Narro will take your bookmarked articles and read them back to you as a podcast. ... http://www.narro.co/faq ... <ul class=\"linkList\"></ul>",
21+
"explicit": "no",
22+
"duration": "74"
23+
}
24+
}
25+
],
26+
"feedUrl": "http://on.narro.co/f",
27+
"title": "foobar on Narro",
28+
"description": "foobar uses Narro to create a podcast of articles transcribed to audio.",
29+
"pubDate": "Fri, 08 Jul 2016 13:40:00 UTC",
30+
"webMaster": "josh@narro.co",
31+
"managingEditor": "foobar@gmail.com",
32+
"generator": "gopod - http://github.com/jbckmn/gopod",
33+
"link": "http://on.narro.co/f",
34+
"itunes": {
35+
"owner": {
36+
"name": "foobar",
37+
"email": "foobar@gmail.com"
38+
},
39+
"image": "https://www.narro.co/images/narro-icon-lg.png",
40+
"author": "foobar@gmail.com",
41+
"subtitle": "foobar uses Narro to create a podcast of articles transcribed to audio.",
42+
"summary": "foobar uses Narro to create a podcast of articles transcribed to audio.",
43+
"explicit": "no"
44+
}
45+
}
46+
}

test/parser.js

+3
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ describe('Parser', function() {
6464
it('should parse Feedburner', function(done) {
6565
testParseForFile('feedburner', 'atom', done);
6666
});
67+
it('should parse podcasts', function(done) {
68+
testParseForFile('narro', 'rss', done);
69+
});
6770
})

0 commit comments

Comments
 (0)