feedjira 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +15 -0
  4. data/.travis.yml +31 -12
  5. data/CHANGELOG.md +34 -1
  6. data/Dangerfile +1 -0
  7. data/Gemfile +2 -1
  8. data/LICENSE +1 -1
  9. data/README.md +210 -7
  10. data/Rakefile +11 -1
  11. data/feedjira.gemspec +17 -14
  12. data/fixtures/vcr_cassettes/fetch_failure.yml +62 -0
  13. data/fixtures/vcr_cassettes/parse_error.yml +222 -0
  14. data/fixtures/vcr_cassettes/success.yml +281 -0
  15. data/lib/feedjira/configuration.rb +76 -0
  16. data/lib/feedjira/core_ext/date.rb +3 -1
  17. data/lib/feedjira/core_ext/string.rb +2 -1
  18. data/lib/feedjira/core_ext/time.rb +24 -17
  19. data/lib/feedjira/core_ext.rb +3 -3
  20. data/lib/feedjira/date_time_utilities/date_time_epoch_parser.rb +13 -0
  21. data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +24 -0
  22. data/lib/feedjira/date_time_utilities/date_time_pattern_parser.rb +34 -0
  23. data/lib/feedjira/date_time_utilities.rb +32 -0
  24. data/lib/feedjira/feed.rb +89 -62
  25. data/lib/feedjira/feed_entry_utilities.rb +20 -19
  26. data/lib/feedjira/feed_utilities.rb +37 -22
  27. data/lib/feedjira/parser/atom.rb +10 -8
  28. data/lib/feedjira/parser/atom_entry.rb +11 -13
  29. data/lib/feedjira/parser/atom_feed_burner.rb +27 -10
  30. data/lib/feedjira/parser/atom_feed_burner_entry.rb +12 -14
  31. data/lib/feedjira/parser/atom_youtube.rb +21 -0
  32. data/lib/feedjira/parser/atom_youtube_entry.rb +30 -0
  33. data/lib/feedjira/parser/google_docs_atom.rb +8 -7
  34. data/lib/feedjira/parser/google_docs_atom_entry.rb +13 -11
  35. data/lib/feedjira/parser/itunes_rss.rb +41 -22
  36. data/lib/feedjira/parser/itunes_rss_category.rb +39 -0
  37. data/lib/feedjira/parser/itunes_rss_item.rb +32 -20
  38. data/lib/feedjira/parser/itunes_rss_owner.rb +4 -4
  39. data/lib/feedjira/parser/podlove_chapter.rb +22 -0
  40. data/lib/feedjira/parser/rss.rb +11 -8
  41. data/lib/feedjira/parser/rss_entry.rb +17 -21
  42. data/lib/feedjira/parser/rss_feed_burner.rb +5 -6
  43. data/lib/feedjira/parser/rss_feed_burner_entry.rb +24 -28
  44. data/lib/feedjira/parser/rss_image.rb +15 -0
  45. data/lib/feedjira/parser.rb +1 -1
  46. data/lib/feedjira/preprocessor.rb +4 -2
  47. data/lib/feedjira/version.rb +1 -1
  48. data/lib/feedjira.rb +15 -0
  49. data/spec/feedjira/configuration_spec.rb +25 -0
  50. data/spec/feedjira/date_time_utilities_spec.rb +47 -0
  51. data/spec/feedjira/feed_entry_utilities_spec.rb +23 -19
  52. data/spec/feedjira/feed_spec.rb +140 -75
  53. data/spec/feedjira/feed_utilities_spec.rb +83 -63
  54. data/spec/feedjira/parser/atom_entry_spec.rb +54 -34
  55. data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +27 -20
  56. data/spec/feedjira/parser/atom_feed_burner_spec.rb +87 -30
  57. data/spec/feedjira/parser/atom_spec.rb +50 -48
  58. data/spec/feedjira/parser/atom_youtube_entry_spec.rb +86 -0
  59. data/spec/feedjira/parser/atom_youtube_spec.rb +43 -0
  60. data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +5 -4
  61. data/spec/feedjira/parser/google_docs_atom_spec.rb +6 -6
  62. data/spec/feedjira/parser/itunes_rss_item_spec.rb +49 -29
  63. data/spec/feedjira/parser/itunes_rss_owner_spec.rb +10 -9
  64. data/spec/feedjira/parser/itunes_rss_spec.rb +87 -30
  65. data/spec/feedjira/parser/podlove_chapter_spec.rb +37 -0
  66. data/spec/feedjira/parser/rss_entry_spec.rb +50 -33
  67. data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +55 -33
  68. data/spec/feedjira/parser/rss_feed_burner_spec.rb +31 -26
  69. data/spec/feedjira/parser/rss_spec.rb +56 -24
  70. data/spec/feedjira/preprocessor_spec.rb +11 -3
  71. data/spec/sample_feeds/AmazonWebServicesBlog.xml +797 -797
  72. data/spec/sample_feeds/AtomEscapedHTMLInPreTag.xml +13 -0
  73. data/spec/sample_feeds/CRE.xml +5849 -0
  74. data/spec/sample_feeds/FeedBurnerXHTML.xml +400 -400
  75. data/spec/sample_feeds/GiantRobotsSmashingIntoOtherGiantRobots.xml +682 -0
  76. data/spec/sample_feeds/ITunesWithSingleQuotedAttributes.xml +67 -0
  77. data/spec/sample_feeds/InvalidDateFormat.xml +20 -0
  78. data/spec/sample_feeds/PaulDixExplainsNothing.xml +175 -175
  79. data/spec/sample_feeds/PaulDixExplainsNothingAlternate.xml +175 -175
  80. data/spec/sample_feeds/PaulDixExplainsNothingFirstEntryContent.xml +16 -16
  81. data/spec/sample_feeds/PaulDixExplainsNothingWFW.xml +174 -174
  82. data/spec/sample_feeds/TenderLovemaking.xml +12 -2
  83. data/spec/sample_feeds/TrotterCashionHome.xml +611 -611
  84. data/spec/sample_feeds/TypePadNews.xml +368 -368
  85. data/spec/sample_feeds/itunes.xml +31 -2
  86. data/spec/sample_feeds/pet_atom.xml +229 -229
  87. data/spec/sample_feeds/youtube_atom.xml +395 -0
  88. data/spec/sample_feeds.rb +31 -21
  89. data/spec/spec_helper.rb +6 -0
  90. metadata +132 -25
@@ -0,0 +1,395 @@
1
+
2
+ <?xml version="1.0" encoding="UTF-8"?>
3
+ <feed xmlns:yt="http://www.youtube.com/xml/schemas/2015" xmlns:media="http://search.yahoo.com/mrss/" xmlns="http://www.w3.org/2005/Atom">
4
+ <link rel="self" href="http://www.youtube.com/feeds/videos.xml?user=google"/>
5
+ <id>yt:channel:UCK8sQmJBp8GCxrOtXWBpyEA</id>
6
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
7
+ <title>Google</title>
8
+ <link rel="alternate" href="http://www.youtube.com/user/Google"/>
9
+ <author>
10
+ <name>Google Author</name>
11
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
12
+ </author>
13
+ <published>2005-09-18T22:37:10+00:00</published>
14
+ <updated>2015-05-04T00:01:27+00:00</updated>
15
+ <entry>
16
+ <id>yt:video:5shykyfmb28</id>
17
+ <yt:videoId>5shykyfmb28</yt:videoId>
18
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
19
+ <title>The Google app: Questions Title</title>
20
+ <link rel="alternate" href="http://www.youtube.com/watch?v=5shykyfmb28"/>
21
+ <author>
22
+ <name>Google</name>
23
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
24
+ </author>
25
+ <published>2015-05-04T00:01:27+00:00</published>
26
+ <updated>2015-05-13T17:38:30+00:00</updated>
27
+ <media:group>
28
+ <media:title>The Google app: Questions</media:title>
29
+ <media:content url="https://www.youtube.com/v/5shykyfmb28?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
30
+ <media:thumbnail url="https://i2.ytimg.com/vi/5shykyfmb28/hqdefault.jpg" width="480" height="360"/>
31
+ <media:description>A question is the most powerful force in the world. It can start you on an adventure or spark a connection. See where a question can take you. The Google app is available on iOS and Android. Download the app here: http://www.google.com/search/about/download</media:description>
32
+ <media:community>
33
+ <media:starRating count="3546" average="4.79" min="1" max="5"/>
34
+ <media:statistics views="251497"/>
35
+ </media:community>
36
+ </media:group>
37
+ </entry>
38
+ <entry>
39
+ <id>yt:video:xfFHnBQ6nQg</id>
40
+ <yt:videoId>xfFHnBQ6nQg</yt:videoId>
41
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
42
+ <title>Project Fi: Innovating in connectivity and communication</title>
43
+ <link rel="alternate" href="http://www.youtube.com/watch?v=xfFHnBQ6nQg"/>
44
+ <author>
45
+ <name>Google</name>
46
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
47
+ </author>
48
+ <published>2015-04-23T15:29:38+00:00</published>
49
+ <updated>2015-05-13T18:32:00+00:00</updated>
50
+ <media:group>
51
+ <media:title>Project Fi: Innovating in connectivity and communication</media:title>
52
+ <media:content url="https://www.youtube.com/v/xfFHnBQ6nQg?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
53
+ <media:thumbnail url="https://i1.ytimg.com/vi/xfFHnBQ6nQg/hqdefault.jpg" width="480" height="360"/>
54
+ <media:description>A behind-the-scenes look at Project Fi. Find out more at fi.google.com.</media:description>
55
+ <media:community>
56
+ <media:starRating count="3915" average="4.77" min="1" max="5"/>
57
+ <media:statistics views="498948"/>
58
+ </media:community>
59
+ </media:group>
60
+ </entry>
61
+ <entry>
62
+ <id>yt:video:faacIELjUeI</id>
63
+ <yt:videoId>faacIELjUeI</yt:videoId>
64
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
65
+ <title>Project Fi: A new way to say hello</title>
66
+ <link rel="alternate" href="http://www.youtube.com/watch?v=faacIELjUeI"/>
67
+ <author>
68
+ <name>Google</name>
69
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
70
+ </author>
71
+ <published>2015-04-23T15:29:11+00:00</published>
72
+ <updated>2015-05-13T17:51:58+00:00</updated>
73
+ <media:group>
74
+ <media:title>Project Fi: A new way to say hello</media:title>
75
+ <media:content url="https://www.youtube.com/v/faacIELjUeI?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
76
+ <media:thumbnail url="https://i3.ytimg.com/vi/faacIELjUeI/hqdefault.jpg" width="480" height="360"/>
77
+ <media:description>Introducing Project Fi, a new way to say hello. Find out more at fi.google.com.</media:description>
78
+ <media:community>
79
+ <media:starRating count="2963" average="4.83" min="1" max="5"/>
80
+ <media:statistics views="204324"/>
81
+ </media:community>
82
+ </media:group>
83
+ </entry>
84
+ <entry>
85
+ <id>yt:video:hydLZJXG3Tk</id>
86
+ <yt:videoId>hydLZJXG3Tk</yt:videoId>
87
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
88
+ <title>Smartbox by Inbox: the mailbox of tomorrow, today</title>
89
+ <link rel="alternate" href="http://www.youtube.com/watch?v=hydLZJXG3Tk"/>
90
+ <author>
91
+ <name>Google</name>
92
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
93
+ </author>
94
+ <published>2015-04-01T01:00:28+00:00</published>
95
+ <updated>2015-05-13T17:41:04+00:00</updated>
96
+ <media:group>
97
+ <media:title>Smartbox by Inbox: the mailbox of tomorrow, today</media:title>
98
+ <media:content url="https://www.youtube.com/v/hydLZJXG3Tk?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
99
+ <media:thumbnail url="https://i1.ytimg.com/vi/hydLZJXG3Tk/hqdefault.jpg" width="480" height="360"/>
100
+ <media:description>We’re excited to introduce Smartbox—a better, smarter mailbox that fuses physical mail with everything you love about the electronic kind.
101
+
102
+ Smartbox isn't real. But Inbox by Gmail is. Email inbox@google.com from an @gmail.com address to request an invite.
103
+
104
+ https://www.google.com/inbox</media:description>
105
+ <media:community>
106
+ <media:starRating count="13463" average="4.75" min="1" max="5"/>
107
+ <media:statistics views="1376473"/>
108
+ </media:community>
109
+ </media:group>
110
+ </entry>
111
+ <entry>
112
+ <id>yt:video:1lxNpMHhJFA</id>
113
+ <yt:videoId>1lxNpMHhJFA</yt:videoId>
114
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
115
+ <title>The Google app: Windy</title>
116
+ <link rel="alternate" href="http://www.youtube.com/watch?v=1lxNpMHhJFA"/>
117
+ <author>
118
+ <name>Google</name>
119
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
120
+ </author>
121
+ <published>2015-03-18T19:27:58+00:00</published>
122
+ <updated>2015-05-13T06:50:30+00:00</updated>
123
+ <media:group>
124
+ <media:title>The Google app: Windy</media:title>
125
+ <media:content url="https://www.youtube.com/v/1lxNpMHhJFA?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
126
+ <media:thumbnail url="https://i2.ytimg.com/vi/1lxNpMHhJFA/hqdefault.jpg" width="480" height="360"/>
127
+ <media:description>“Ok Google, how windy is it right now?”
128
+ Talk to Google to get answers, find stuff nearby, and get things done. The Google app. Available on iOS and Android. Go to g.co/googleapp on your mobile browser to download.</media:description>
129
+ <media:community>
130
+ <media:starRating count="2211" average="4.42" min="1" max="5"/>
131
+ <media:statistics views="204663"/>
132
+ </media:community>
133
+ </media:group>
134
+ </entry>
135
+ <entry>
136
+ <id>yt:video:PRU2ShMzQRg</id>
137
+ <yt:videoId>PRU2ShMzQRg</yt:videoId>
138
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
139
+ <title>Building Bridges with Pope Francis and Students Over the Web</title>
140
+ <link rel="alternate" href="http://www.youtube.com/watch?v=PRU2ShMzQRg"/>
141
+ <author>
142
+ <name>Google</name>
143
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
144
+ </author>
145
+ <published>2015-03-12T16:33:46+00:00</published>
146
+ <updated>2015-05-13T13:58:33+00:00</updated>
147
+ <media:group>
148
+ <media:title>Building Bridges with Pope Francis and Students Over the Web</media:title>
149
+ <media:content url="https://www.youtube.com/v/PRU2ShMzQRg?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
150
+ <media:thumbnail url="https://i1.ytimg.com/vi/PRU2ShMzQRg/hqdefault.jpg" width="480" height="360"/>
151
+ <media:description>On February 5th, Pope Francis hosted a Google+ Hangout on how technology can help improve the education of students with disabilities. In the Hangout, which was led by Scholas Occurrentes, The Pope was joined by students from around the world including India, Spain, Brazil, and the United States.
152
+
153
+ Watch the full Hangout here: http://goo.gl/f3ZpkD</media:description>
154
+ <media:community>
155
+ <media:starRating count="3187" average="4.22" min="1" max="5"/>
156
+ <media:statistics views="914420"/>
157
+ </media:community>
158
+ </media:group>
159
+ </entry>
160
+ <entry>
161
+ <id>yt:video:t4vkQAByALc</id>
162
+ <yt:videoId>t4vkQAByALc</yt:videoId>
163
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
164
+ <title>Introducing Google Calendar for iPhone</title>
165
+ <link rel="alternate" href="http://www.youtube.com/watch?v=t4vkQAByALc"/>
166
+ <author>
167
+ <name>Google</name>
168
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
169
+ </author>
170
+ <published>2015-03-10T17:26:23+00:00</published>
171
+ <updated>2015-05-13T07:37:22+00:00</updated>
172
+ <media:group>
173
+ <media:title>Introducing Google Calendar for iPhone</media:title>
174
+ <media:content url="https://www.youtube.com/v/t4vkQAByALc?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
175
+ <media:thumbnail url="https://i1.ytimg.com/vi/t4vkQAByALc/hqdefault.jpg" width="480" height="360"/>
176
+ <media:description>Meet Google Calendar for iPhone. It’s designed to be a helpful assistant, so you can spend less time managing your day, and more time enjoying it.
177
+
178
+ Learn more at http://g.co/calendar</media:description>
179
+ <media:community>
180
+ <media:starRating count="3294" average="4.14" min="1" max="5"/>
181
+ <media:statistics views="915335"/>
182
+ </media:community>
183
+ </media:group>
184
+ </entry>
185
+ <entry>
186
+ <id>yt:video:C57obdJnxQo</id>
187
+ <yt:videoId>C57obdJnxQo</yt:videoId>
188
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
189
+ <title>Student Becomes Teacher - Google Compare</title>
190
+ <link rel="alternate" href="http://www.youtube.com/watch?v=C57obdJnxQo"/>
191
+ <author>
192
+ <name>Google</name>
193
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
194
+ </author>
195
+ <published>2015-03-05T18:10:24+00:00</published>
196
+ <updated>2015-05-13T15:44:10+00:00</updated>
197
+ <media:group>
198
+ <media:title>Student Becomes Teacher - Google Compare</media:title>
199
+ <media:content url="https://www.youtube.com/v/C57obdJnxQo?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
200
+ <media:thumbnail url="https://i4.ytimg.com/vi/C57obdJnxQo/hqdefault.jpg" width="480" height="360"/>
201
+ <media:description>When two generations come together, each learns something from the other. In this heartfelt story, when grandpa and granddaughter spend time together fixing up an old classic car they both learn something new. The lesson for all of us is to spend less time online and more time on the road; spend less time looking for car insurance and more time doing the things you like with the people you love, with help from Google Compare.
202
+
203
+ See how you can compare multiple car insurance quotes easily on your mobile, desktop, or tablet at www.google.com/compare</media:description>
204
+ <media:community>
205
+ <media:starRating count="1348" average="4.66" min="1" max="5"/>
206
+ <media:statistics views="86705"/>
207
+ </media:community>
208
+ </media:group>
209
+ </entry>
210
+ <entry>
211
+ <id>yt:video:z3v4rIG8kQA</id>
212
+ <yt:videoId>z3v4rIG8kQA</yt:videoId>
213
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
214
+ <title>Google's Proposal for North Bayshore</title>
215
+ <link rel="alternate" href="http://www.youtube.com/watch?v=z3v4rIG8kQA"/>
216
+ <author>
217
+ <name>Google</name>
218
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
219
+ </author>
220
+ <published>2015-02-27T18:54:22+00:00</published>
221
+ <updated>2015-05-13T18:43:42+00:00</updated>
222
+ <media:group>
223
+ <media:title>Google's Proposal for North Bayshore</media:title>
224
+ <media:content url="https://www.youtube.com/v/z3v4rIG8kQA?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
225
+ <media:thumbnail url="https://i3.ytimg.com/vi/z3v4rIG8kQA/hqdefault.jpg" width="480" height="360"/>
226
+ <media:description>Vice President of Real Estate Dave Radcliffe and architects Thomas Heatherwick and Bjarke Ingels discuss our proposed Master Plan for our new campus in Mountain View, California. With our proposal, our focus is on creating space for people, nature and ideas to thrive.</media:description>
227
+ <media:community>
228
+ <media:starRating count="8893" average="4.75" min="1" max="5"/>
229
+ <media:statistics views="1180615"/>
230
+ </media:community>
231
+ </media:group>
232
+ </entry>
233
+ <entry>
234
+ <id>yt:video:RyRbsmmRKnE</id>
235
+ <yt:videoId>RyRbsmmRKnE</yt:videoId>
236
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
237
+ <title>HolaGoogle: Soy Kary on Google+ Photos</title>
238
+ <link rel="alternate" href="http://www.youtube.com/watch?v=RyRbsmmRKnE"/>
239
+ <author>
240
+ <name>Google</name>
241
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
242
+ </author>
243
+ <published>2015-02-02T22:15:17+00:00</published>
244
+ <updated>2015-05-13T03:00:34+00:00</updated>
245
+ <media:group>
246
+ <media:title>HolaGoogle: Soy Kary on Google+ Photos</media:title>
247
+ <media:content url="https://www.youtube.com/v/RyRbsmmRKnE?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
248
+ <media:thumbnail url="https://i3.ytimg.com/vi/RyRbsmmRKnE/hqdefault.jpg" width="480" height="360"/>
249
+ <media:description>Kary Pérez chose travel over the traditional quinceañera. From monuments in Istanbul to cafes in Madrid, Kary's story continues as she explores the world around her. Learn how she uses Google+ Photos.
250
+
251
+ Kary’s story is featured on Holagoogle.soy, which aims to bring the best of Google to the Hispanic community in a culturally relevant way. The site highlights our users and the cool things they are doing with Google products. Visit holagoogle.soy to discover other Latinos doing cool things with Google products and share your own story.</media:description>
252
+ <media:community>
253
+ <media:starRating count="1438" average="4.37" min="1" max="5"/>
254
+ <media:statistics views="91894"/>
255
+ </media:community>
256
+ </media:group>
257
+ </entry>
258
+ <entry>
259
+ <id>yt:video:DVwHCGAr_OE</id>
260
+ <yt:videoId>DVwHCGAr_OE</yt:videoId>
261
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
262
+ <title>Google - Year in Search 2014</title>
263
+ <link rel="alternate" href="http://www.youtube.com/watch?v=DVwHCGAr_OE"/>
264
+ <author>
265
+ <name>Google</name>
266
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
267
+ </author>
268
+ <published>2014-12-16T06:57:19+00:00</published>
269
+ <updated>2015-05-13T16:44:47+00:00</updated>
270
+ <media:group>
271
+ <media:title>Google - Year in Search 2014</media:title>
272
+ <media:content url="https://www.youtube.com/v/DVwHCGAr_OE?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
273
+ <media:thumbnail url="https://i1.ytimg.com/vi/DVwHCGAr_OE/hqdefault.jpg" width="480" height="360"/>
274
+ <media:description>In 2014 we searched trillions of times. What do these searches say about us? Explore the Year in Search http://www.google.com/2014 and follow the conversation on #YearInSearch
275
+
276
+ Watch past Year in Search videos: http://goo.gl/LXA4nQ
277
+
278
+ Soundtrack is ‘Divinity’, by Porter Robinson
279
+ Porter Robinon's new album 'Worlds' is available on Google Play: http://goo.gl/q6ljz4
280
+
281
+ Nicky Minaj's new album 'The Pinkprint' is available on Google Play: http://goo.gl/utOZxd
282
+ HBO’s Game of Thrones is available on Google Play (not all countries are eligible): http://goo.gl/xOgofr
283
+
284
+ Credits:
285
+ Two people hugging: Dida Mulder
286
+ Boy with 3D Printed hand: E-NABLE/RIT University News/RIT MAGIC Center
287
+ Ebola doctors and patients: Plan International
288
+ Perth passenger train footage: vision courtesy of the Public Transport Authority of Western Australia
289
+ Malala Yousafzai collecting the Nobel Peace Prize: Nobel Media AB
290
+ Bill Nye's voice over: Big Think. Original video: http://goo.gl/aK9yDI
291
+ Follow Big Think on YouTube: http://goo.gl/CPTsV5</media:description>
292
+ <media:community>
293
+ <media:starRating count="101801" average="4.68" min="1" max="5"/>
294
+ <media:statistics views="32470726"/>
295
+ </media:community>
296
+ </media:group>
297
+ </entry>
298
+ <entry>
299
+ <id>yt:video:8IP7Y5B2-Io</id>
300
+ <yt:videoId>8IP7Y5B2-Io</yt:videoId>
301
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
302
+ <title>.SOY, un dominio para Latinos</title>
303
+ <link rel="alternate" href="http://www.youtube.com/watch?v=8IP7Y5B2-Io"/>
304
+ <author>
305
+ <name>Google</name>
306
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
307
+ </author>
308
+ <published>2014-12-04T01:35:21+00:00</published>
309
+ <updated>2015-05-13T15:11:37+00:00</updated>
310
+ <media:group>
311
+ <media:title>.SOY, un dominio para Latinos</media:title>
312
+ <media:content url="https://www.youtube.com/v/8IP7Y5B2-Io?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
313
+ <media:thumbnail url="https://i1.ytimg.com/vi/8IP7Y5B2-Io/hqdefault.jpg" width="480" height="360"/>
314
+ <media:description>Presentando .SOY, un nuevo dominio para la comunidad latina. La web está creciendo y .SOY es una manera nueva para expresarte en línea. Para tu sitio web para tu arte, tu negocio o tus ideas -- utiliza .SOY. Visita iam.soy para conseguir tu propio dominio hoy mismo.</media:description>
315
+ <media:community>
316
+ <media:starRating count="1522" average="3.90" min="1" max="5"/>
317
+ <media:statistics views="226952"/>
318
+ </media:community>
319
+ </media:group>
320
+ </entry>
321
+ <entry>
322
+ <id>yt:video:ayFAQ2OoJaA</id>
323
+ <yt:videoId>ayFAQ2OoJaA</yt:videoId>
324
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
325
+ <title>Meet your new Inbox</title>
326
+ <link rel="alternate" href="http://www.youtube.com/watch?v=ayFAQ2OoJaA"/>
327
+ <author>
328
+ <name>Google</name>
329
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
330
+ </author>
331
+ <published>2014-11-19T18:45:37+00:00</published>
332
+ <updated>2015-05-13T18:24:06+00:00</updated>
333
+ <media:group>
334
+ <media:title>Meet your new Inbox</media:title>
335
+ <media:content url="https://www.youtube.com/v/ayFAQ2OoJaA?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
336
+ <media:thumbnail url="https://i2.ytimg.com/vi/ayFAQ2OoJaA/hqdefault.jpg" width="480" height="360"/>
337
+ <media:description>Welcome to the inbox that works for you. Learn about the key features of Inbox by Gmail to help you get started.</media:description>
338
+ <media:community>
339
+ <media:starRating count="26688" average="4.81" min="1" max="5"/>
340
+ <media:statistics views="2068228"/>
341
+ </media:community>
342
+ </media:group>
343
+ </entry>
344
+ <entry>
345
+ <id>yt:video:otCe903imh0</id>
346
+ <yt:videoId>otCe903imh0</yt:videoId>
347
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
348
+ <title>Google Hindi Input</title>
349
+ <link rel="alternate" href="http://www.youtube.com/watch?v=otCe903imh0"/>
350
+ <author>
351
+ <name>Google</name>
352
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
353
+ </author>
354
+ <published>2014-11-14T22:44:47+00:00</published>
355
+ <updated>2015-05-13T14:50:21+00:00</updated>
356
+ <media:group>
357
+ <media:title>Google Hindi Input</media:title>
358
+ <media:content url="https://www.youtube.com/v/otCe903imh0?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
359
+ <media:thumbnail url="https://i4.ytimg.com/vi/otCe903imh0/hqdefault.jpg" width="480" height="360"/>
360
+ <media:description>This video introduces new features of Google Hindi Input, including material design, Hinglish suggestion, full-screen handwriting etc.
361
+
362
+ Download Google Hindi input at:
363
+ https://play.google.com/store/apps/details?id=com.google.android.apps.inputmethod.hindi&amp;hl=en</media:description>
364
+ <media:community>
365
+ <media:starRating count="1586" average="3.83" min="1" max="5"/>
366
+ <media:statistics views="237388"/>
367
+ </media:community>
368
+ </media:group>
369
+ </entry>
370
+ <entry>
371
+ <id>yt:video:8ztbpW3THmI</id>
372
+ <yt:videoId>8ztbpW3THmI</yt:videoId>
373
+ <yt:channelId>UCK8sQmJBp8GCxrOtXWBpyEA</yt:channelId>
374
+ <title>Veterans Make Great Googlers. Find your team: Specialists</title>
375
+ <link rel="alternate" href="http://www.youtube.com/watch?v=8ztbpW3THmI"/>
376
+ <author>
377
+ <name>Google</name>
378
+ <uri>http://www.youtube.com/channel/UCK8sQmJBp8GCxrOtXWBpyEA</uri>
379
+ </author>
380
+ <published>2014-11-11T17:25:52+00:00</published>
381
+ <updated>2015-05-12T16:22:28+00:00</updated>
382
+ <media:group>
383
+ <media:title>Veterans Make Great Googlers. Find your team: Specialists</media:title>
384
+ <media:content url="https://www.youtube.com/v/8ztbpW3THmI?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
385
+ <media:thumbnail url="https://i1.ytimg.com/vi/8ztbpW3THmI/hqdefault.jpg" width="480" height="360"/>
386
+ <media:description>There are many departments at Google that enable our engineering and sales organizations to thrive. Be one of the specialists at Google who plays a vital role in keeping our business running, including hiring, legal, finance and security.
387
+
388
+ http://www.google.com/careers/veterans</media:description>
389
+ <media:community>
390
+ <media:starRating count="592" average="3.97" min="1" max="5"/>
391
+ <media:statistics views="61469"/>
392
+ </media:community>
393
+ </media:group>
394
+ </entry>
395
+ </feed>
data/spec/sample_feeds.rb CHANGED
@@ -1,26 +1,34 @@
1
+ # rubocop:disable Metrics/LineLength
2
+
1
3
  module SampleFeeds
2
4
  FEEDS = {
3
- sample_atom_feed: "AmazonWebServicesBlog.xml",
4
- sample_atom_middleman_feed: "FeedjiraBlog.xml",
5
- sample_atom_xhtml_feed: "pet_atom.xml",
6
- sample_atom_feed_line_breaks: "AtomFeedWithSpacesAroundEquals.xml",
7
- sample_atom_entry_content: "AmazonWebServicesBlogFirstEntryContent.xml",
8
- sample_itunes_feed: "itunes.xml",
9
- sample_itunes_feed_with_spaces: "ITunesWithSpacesInAttributes.xml",
10
- sample_rdf_feed: "HREFConsideredHarmful.xml",
11
- sample_rdf_entry_content: "HREFConsideredHarmfulFirstEntry.xml",
12
- sample_rss_feed_burner_feed: "TechCrunch.xml",
13
- sample_rss_feed_burner_entry_content: "TechCrunchFirstEntry.xml",
14
- sample_rss_feed_burner_entry_description: "TechCrunchFirstEntryDescription.xml",
15
- sample_rss_feed: "TenderLovemaking.xml",
16
- sample_rss_entry_content: "TenderLovemakingFirstEntry.xml",
17
- sample_feedburner_atom_feed: "PaulDixExplainsNothing.xml",
18
- sample_feedburner_atom_entry_content: "PaulDixExplainsNothingFirstEntryContent.xml",
19
- sample_wfw_feed: "PaulDixExplainsNothingWFW.xml",
20
- sample_google_docs_list_feed: "GoogleDocsList.xml",
21
- sample_feed_burner_atom_xhtml_feed: "FeedBurnerXHTML.xml",
22
- sample_duplicate_content_atom_feed: "DuplicateContentAtomFeed.xml"
23
- }
5
+ sample_atom_feed: 'AmazonWebServicesBlog.xml',
6
+ sample_atom_middleman_feed: 'FeedjiraBlog.xml',
7
+ sample_atom_xhtml_feed: 'pet_atom.xml',
8
+ sample_atom_feed_line_breaks: 'AtomFeedWithSpacesAroundEquals.xml',
9
+ sample_atom_entry_content: 'AmazonWebServicesBlogFirstEntryContent.xml',
10
+ sample_itunes_feed: 'itunes.xml',
11
+ sample_itunes_feed_with_single_quotes: 'ITunesWithSingleQuotedAttributes.xml',
12
+ sample_itunes_feed_with_spaces: 'ITunesWithSpacesInAttributes.xml',
13
+ sample_podlove_feed: 'CRE.xml',
14
+ sample_rdf_feed: 'HREFConsideredHarmful.xml',
15
+ sample_rdf_entry_content: 'HREFConsideredHarmfulFirstEntry.xml',
16
+ sample_rss_feed_burner_feed: 'TechCrunch.xml',
17
+ sample_rss_feed_burner_entry_content: 'TechCrunchFirstEntry.xml',
18
+ sample_rss_feed_burner_entry_description: 'TechCrunchFirstEntryDescription.xml',
19
+ sample_rss_feed: 'TenderLovemaking.xml',
20
+ sample_rss_entry_content: 'TenderLovemakingFirstEntry.xml',
21
+ sample_feedburner_atom_feed: 'PaulDixExplainsNothing.xml',
22
+ sample_feedburner_atom_feed_alternate: 'GiantRobotsSmashingIntoOtherGiantRobots.xml',
23
+ sample_feedburner_atom_entry_content: 'PaulDixExplainsNothingFirstEntryContent.xml',
24
+ sample_wfw_feed: 'PaulDixExplainsNothingWFW.xml',
25
+ sample_google_docs_list_feed: 'GoogleDocsList.xml',
26
+ sample_feed_burner_atom_xhtml_feed: 'FeedBurnerXHTML.xml',
27
+ sample_duplicate_content_atom_feed: 'DuplicateContentAtomFeed.xml',
28
+ sample_youtube_atom_feed: 'youtube_atom.xml',
29
+ sample_atom_xhtml_with_escpaed_html_in_pre_tag_feed: 'AtomEscapedHTMLInPreTag.xml',
30
+ sample_invalid_date_format_feed: 'InvalidDateFormat.xml'
31
+ }.freeze
24
32
 
25
33
  FEEDS.each do |method, filename|
26
34
  define_method(method) { load_sample filename }
@@ -30,3 +38,5 @@ module SampleFeeds
30
38
  File.read("#{File.dirname(__FILE__)}/sample_feeds/#{filename}")
31
39
  end
32
40
  end
41
+
42
+ # rubocop:enable Metrics/LineLength
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,14 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/../lib/feedjira')
2
2
  require 'sample_feeds'
3
+ require 'vcr'
3
4
 
4
5
  SAXMachine.handler = ENV['HANDLER'].to_sym if ENV['HANDLER']
5
6
 
7
+ VCR.configure do |config|
8
+ config.cassette_library_dir = 'fixtures/vcr_cassettes'
9
+ config.hook_into :faraday
10
+ end
11
+
6
12
  RSpec.configure do |c|
7
13
  c.include SampleFeeds
8
14
  end