feedjira 3.0.0.beta1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +5 -5
  2. data/.github/ISSUE_TEMPLATE/feed-parsing.md +15 -0
  3. data/.github/workflows/ruby.yml +39 -0
  4. data/.rubocop.yml +18 -628
  5. data/.rubocop_todo.yml +11 -0
  6. data/CHANGELOG.md +66 -9
  7. data/Gemfile +4 -1
  8. data/README.md +10 -1
  9. data/Rakefile +3 -1
  10. data/feedjira.gemspec +14 -12
  11. data/lib/feedjira.rb +9 -3
  12. data/lib/feedjira/atom_entry_utilities.rb +51 -0
  13. data/lib/feedjira/configuration.rb +6 -3
  14. data/lib/feedjira/core_ext.rb +2 -0
  15. data/lib/feedjira/core_ext/date.rb +3 -2
  16. data/lib/feedjira/core_ext/string.rb +2 -1
  17. data/lib/feedjira/core_ext/time.rb +10 -10
  18. data/lib/feedjira/date_time_utilities.rb +8 -10
  19. data/lib/feedjira/date_time_utilities/date_time_epoch_parser.rb +3 -2
  20. data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +4 -4
  21. data/lib/feedjira/date_time_utilities/date_time_pattern_parser.rb +9 -13
  22. data/lib/feedjira/feed.rb +3 -3
  23. data/lib/feedjira/feed_entry_utilities.rb +15 -8
  24. data/lib/feedjira/feed_utilities.rb +5 -4
  25. data/lib/feedjira/parser.rb +2 -0
  26. data/lib/feedjira/parser/atom.rb +5 -7
  27. data/lib/feedjira/parser/atom_entry.rb +4 -21
  28. data/lib/feedjira/parser/atom_feed_burner.rb +4 -3
  29. data/lib/feedjira/parser/atom_feed_burner_entry.rb +7 -18
  30. data/lib/feedjira/parser/atom_google_alerts.rb +26 -0
  31. data/lib/feedjira/parser/atom_google_alerts_entry.rb +21 -0
  32. data/lib/feedjira/parser/atom_youtube.rb +2 -1
  33. data/lib/feedjira/parser/atom_youtube_entry.rb +8 -7
  34. data/lib/feedjira/parser/globally_unique_identifier.rb +21 -0
  35. data/lib/feedjira/parser/google_docs_atom.rb +4 -4
  36. data/lib/feedjira/parser/google_docs_atom_entry.rb +3 -19
  37. data/lib/feedjira/parser/itunes_rss.rb +4 -3
  38. data/lib/feedjira/parser/itunes_rss_category.rb +6 -5
  39. data/lib/feedjira/parser/itunes_rss_item.rb +5 -8
  40. data/lib/feedjira/parser/itunes_rss_owner.rb +2 -1
  41. data/lib/feedjira/parser/json_feed.rb +4 -2
  42. data/lib/feedjira/parser/json_feed_item.rb +7 -1
  43. data/lib/feedjira/parser/podlove_chapter.rb +3 -2
  44. data/lib/feedjira/parser/rss.rb +4 -2
  45. data/lib/feedjira/parser/rss_entry.rb +3 -28
  46. data/lib/feedjira/parser/rss_feed_burner.rb +3 -2
  47. data/lib/feedjira/parser/rss_feed_burner_entry.rb +6 -26
  48. data/lib/feedjira/parser/rss_image.rb +2 -0
  49. data/lib/feedjira/preprocessor.rb +3 -3
  50. data/lib/feedjira/rss_entry_utilities.rb +53 -0
  51. data/lib/feedjira/version.rb +3 -1
  52. data/spec/feedjira/configuration_spec.rb +5 -3
  53. data/spec/feedjira/date_time_utilities_spec.rb +2 -0
  54. data/spec/feedjira/feed_entry_utilities_spec.rb +4 -2
  55. data/spec/feedjira/feed_spec.rb +3 -1
  56. data/spec/feedjira/feed_utilities_spec.rb +5 -3
  57. data/spec/feedjira/parser/atom_entry_spec.rb +7 -4
  58. data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +7 -5
  59. data/spec/feedjira/parser/atom_feed_burner_spec.rb +4 -2
  60. data/spec/feedjira/parser/atom_google_alerts_entry_spec.rb +34 -0
  61. data/spec/feedjira/parser/atom_google_alerts_spec.rb +62 -0
  62. data/spec/feedjira/parser/atom_spec.rb +30 -9
  63. data/spec/feedjira/parser/atom_youtube_entry_spec.rb +8 -6
  64. data/spec/feedjira/parser/atom_youtube_spec.rb +6 -4
  65. data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +2 -0
  66. data/spec/feedjira/parser/google_docs_atom_spec.rb +2 -0
  67. data/spec/feedjira/parser/itunes_rss_item_spec.rb +3 -1
  68. data/spec/feedjira/parser/itunes_rss_owner_spec.rb +2 -0
  69. data/spec/feedjira/parser/itunes_rss_spec.rb +11 -9
  70. data/spec/feedjira/parser/json_feed_item_spec.rb +5 -3
  71. data/spec/feedjira/parser/json_feed_spec.rb +2 -0
  72. data/spec/feedjira/parser/podlove_chapter_spec.rb +2 -0
  73. data/spec/feedjira/parser/rss_entry_spec.rb +26 -4
  74. data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +9 -7
  75. data/spec/feedjira/parser/rss_feed_burner_spec.rb +3 -1
  76. data/spec/feedjira/parser/rss_spec.rb +2 -0
  77. data/spec/feedjira/preprocessor_spec.rb +4 -2
  78. data/spec/feedjira_spec.rb +22 -1
  79. data/spec/sample_feeds.rb +7 -3
  80. data/spec/sample_feeds/InvalidDateFormat.xml +20 -0
  81. data/spec/sample_feeds/Permalinks.xml +22 -0
  82. data/spec/sample_feeds/a10.xml +72 -0
  83. data/spec/sample_feeds/atom_simple_single_entry.xml +17 -0
  84. data/spec/sample_feeds/atom_simple_single_entry_link_self.xml +17 -0
  85. data/spec/sample_feeds/google_alerts_atom.xml +1 -0
  86. data/spec/spec_helper.rb +3 -7
  87. metadata +44 -47
  88. data/.travis.yml +0 -37
  89. data/Dangerfile +0 -1
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  module Feedjira
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Parser::ITunesRSSItem do
@@ -25,7 +27,7 @@ describe Feedjira::Parser::ITunesRSSItem do
25
27
  end
26
28
 
27
29
  it "should parse the summary" do
28
- summary = "This week we talk about salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and join the party!" # rubocop:disable Metrics/LineLength
30
+ summary = "This week we talk about salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and join the party!"
29
31
  expect(@item.itunes_summary).to eq summary
30
32
  end
31
33
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Parser::ITunesRSSOwner do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  module Feedjira
@@ -7,12 +9,12 @@ module Feedjira
7
9
  expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed)
8
10
  end
9
11
 
10
- it "should return true for an itunes RSS feed with spaces between attribute names, equals sign, and values" do # rubocop:disable Metrics/LineLength
12
+ it "should return true for an itunes RSS feed with spaces between attribute names, equals sign, and values" do
11
13
  expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_spaces)
12
14
  end
13
15
 
14
- it "should return true for an itunes RSS feed with single-quoted attributes" do # rubocop:disable Metrics/LineLength
15
- expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_single_quotes) # rubocop:disable Metrics/LineLength
16
+ it "should return true for an itunes RSS feed with single-quoted attributes" do
17
+ expect(ITunesRSS).to be_able_to_parse(sample_itunes_feed_with_single_quotes)
16
18
  end
17
19
 
18
20
  it "should return fase for an atom feed" do
@@ -74,7 +76,7 @@ module Feedjira
74
76
  end
75
77
 
76
78
  it "should parse the image description" do
77
- description = "All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Music Store" # rubocop:disable Metrics/LineLength
79
+ description = "All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Music Store"
78
80
  expect(@feed.image.description).to eq description
79
81
  end
80
82
 
@@ -85,14 +87,14 @@ module Feedjira
85
87
  "TV & Film",
86
88
  "Arts",
87
89
  "Design",
88
- "Food",
90
+ "Food"
89
91
  ]
90
92
 
91
93
  expect(@feed.itunes_category_paths).to eq [
92
- %w(Technology Gadgets),
94
+ %w[Technology Gadgets],
93
95
  ["TV & Film"],
94
- %w(Arts Design),
95
- %w(Arts Food),
96
+ %w[Arts Design],
97
+ %w[Arts Food]
96
98
  ]
97
99
  end
98
100
 
@@ -101,7 +103,7 @@ module Feedjira
101
103
  end
102
104
 
103
105
  it "should parse the summary" do
104
- summary = "All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Music Store" # rubocop:disable Metrics/LineLength
106
+ summary = "All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Music Store"
105
107
  expect(@feed.itunes_summary).to eq summary
106
108
  end
107
109
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Parser::JSONFeedItem do
@@ -21,7 +23,7 @@ describe Feedjira::Parser::JSONFeedItem do
21
23
  end
22
24
 
23
25
  it "should parse the content" do
24
- content = "<p>On Wednesday night I know where I’ll be — playing keyboard for a few songs at the James Dempsey and the Breakpoints concert benefitting App Camp for Girls.</p>\n\n<p><a href=\"https://www.classy.org/events/-/e126329\">You should get tickets</a>. It’s a fun time for a great cause.</p>\n\n<p>Bonus: James writes about how <a href=\"http://jamesdempsey.net/2017/06/02/wwdc-in-san-jose-full-circle/\">this concert is full circle for him</a>. It’s a special night.</p>" # rubocop:disable Metrics/LineLength
26
+ content = "<p>On Wednesday night I know where I’ll be — playing keyboard for a few songs at the James Dempsey and the Breakpoints concert benefitting App Camp for Girls.</p>\n\n<p><a href=\"https://www.classy.org/events/-/e126329\">You should get tickets</a>. It’s a fun time for a great cause.</p>\n\n<p>Bonus: James writes about how <a href=\"http://jamesdempsey.net/2017/06/02/wwdc-in-san-jose-full-circle/\">this concert is full circle for him</a>. It’s a special night.</p>"
25
27
  expect(@entry.content).to eq content
26
28
  end
27
29
 
@@ -44,7 +46,7 @@ describe Feedjira::Parser::JSONFeedItem do
44
46
 
45
47
  expect(title_value).to eq "James Dempsey and the Breakpoints Benefit App Camp for Girls"
46
48
 
47
- expected_fields = %w(
49
+ expected_fields = %w[
48
50
  author
49
51
  banner_image
50
52
  categories
@@ -58,7 +60,7 @@ describe Feedjira::Parser::JSONFeedItem do
58
60
  title
59
61
  updated
60
62
  url
61
- )
63
+ ]
62
64
  expect(all_fields).to match_array expected_fields
63
65
  end
64
66
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  module Feedjira
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Parser::PodloveChapter do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Parser::RSSEntry do
@@ -35,7 +37,7 @@ describe Feedjira::Parser::RSSEntry do
35
37
  end
36
38
 
37
39
  it "should provide a summary" do
38
- summary = "Oops! When I released nokogiri version 1.0.7, I totally forgot to talk about Nokogiri::Slop() feature that was added. Why is it called \"slop\"? It lets you sloppily explore documents. Basically, it decorates your document with method_missing() that allows you to search your document via method calls.\nGiven this document:\n\ndoc = Nokogiri::Slop&#40;&#60;&#60;-eohtml&#41;\n&#60;html&#62;\n&#160; &#60;body&#62;\n&#160; [...]" # rubocop:disable Metrics/LineLength
40
+ summary = "Oops! When I released nokogiri version 1.0.7, I totally forgot to talk about Nokogiri::Slop() feature that was added. Why is it called \"slop\"? It lets you sloppily explore documents. Basically, it decorates your document with method_missing() that allows you to search your document via method calls.\nGiven this document:\n\ndoc = Nokogiri::Slop&#40;&#60;&#60;-eohtml&#41;\n&#60;html&#62;\n&#160; &#60;body&#62;\n&#160; [...]"
39
41
  expect(@entry.summary).to eq summary
40
42
  end
41
43
 
@@ -45,7 +47,7 @@ describe Feedjira::Parser::RSSEntry do
45
47
  end
46
48
 
47
49
  it "should parse the categories" do
48
- expect(@entry.categories).to eq %w(computadora nokogiri rails)
50
+ expect(@entry.categories).to eq %w[computadora nokogiri rails]
49
51
  end
50
52
 
51
53
  it "should parse the guid as id" do
@@ -66,7 +68,7 @@ describe Feedjira::Parser::RSSEntry do
66
68
 
67
69
  expect(title_value).to eq "Nokogiri’s Slop Feature"
68
70
 
69
- expected_fields = %w(
71
+ expected_fields = %w[
70
72
  author
71
73
  categories
72
74
  comment_rss
@@ -76,7 +78,7 @@ describe Feedjira::Parser::RSSEntry do
76
78
  summary
77
79
  title
78
80
  url
79
- )
81
+ ]
80
82
  expect(all_fields.sort).to eq expected_fields
81
83
  end
82
84
 
@@ -94,4 +96,24 @@ describe Feedjira::Parser::RSSEntry do
94
96
  @entry["title"] = "Foobar"
95
97
  expect(@entry.title).to eq "Foobar"
96
98
  end
99
+
100
+ it "should ignore urls from guids with isPermaLink='false'" do
101
+ feed = Feedjira.parse(sample_rss_feed_permalinks)
102
+ expect(feed.entries[0].url).to eq nil
103
+ end
104
+
105
+ it "should get urls from guids with isPermaLink='true'" do
106
+ feed = Feedjira.parse(sample_rss_feed_permalinks)
107
+ expect(feed.entries[1].url).to eq "http://example.com/2"
108
+ end
109
+
110
+ it "should get urls from guid where isPermaLink is unspecified" do
111
+ feed = Feedjira.parse(sample_rss_feed_permalinks)
112
+ expect(feed.entries[2].url).to eq "http://example.com/3"
113
+ end
114
+
115
+ it "should prefer urls from <link> when both guid and link are specified" do
116
+ feed = Feedjira.parse(sample_rss_feed_permalinks)
117
+ expect(feed.entries[3].url).to eq "http://example.com/4"
118
+ end
97
119
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Parser::RSSFeedBurnerEntry do
@@ -13,19 +15,19 @@ describe Feedjira::Parser::RSSFeedBurnerEntry do
13
15
 
14
16
  after(:each) do
15
17
  # We change the title in one or more specs to test []=
16
- if @entry.title != "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M" # rubocop:disable Metrics/LineLength
18
+ if @entry.title != "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M"
17
19
  feed = Feedjira::Parser::RSS.parse sample_rss_feed_burner_feed
18
20
  @entry.title = feed.entries.first.title
19
21
  end
20
22
  end
21
23
 
22
24
  it "should parse the title" do
23
- title = "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M" # rubocop:disable Metrics/LineLength
25
+ title = "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M"
24
26
  expect(@entry.title).to eq title
25
27
  end
26
28
 
27
29
  it "should parse the original url" do
28
- expect(@entry.url).to eq "http://techcrunch.com/2011/11/02/angies-list-prices-ipo-at-11-to-13-per-share-valued-at-over-600m/" # rubocop:disable Metrics/LineLength
30
+ expect(@entry.url).to eq "http://techcrunch.com/2011/11/02/angies-list-prices-ipo-at-11-to-13-per-share-valued-at-over-600m/"
29
31
  end
30
32
 
31
33
  it "should parse the author" do
@@ -66,10 +68,10 @@ describe Feedjira::Parser::RSSFeedBurnerEntry do
66
68
  title_value = value if field == "title"
67
69
  end
68
70
 
69
- title = "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M" # rubocop:disable Metrics/LineLength
71
+ title = "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M"
70
72
  expect(title_value).to eq title
71
73
 
72
- expected_fields = %w(
74
+ expected_fields = %w[
73
75
  author
74
76
  categories
75
77
  comment_rss
@@ -80,7 +82,7 @@ describe Feedjira::Parser::RSSFeedBurnerEntry do
80
82
  summary
81
83
  title
82
84
  url
83
- )
85
+ ]
84
86
  expect(all_fields.sort).to eq expected_fields
85
87
  end
86
88
 
@@ -91,7 +93,7 @@ describe Feedjira::Parser::RSSFeedBurnerEntry do
91
93
 
92
94
  it "should allow access to fields with hash syntax" do
93
95
  expect(@entry["author"]).to eq "Leena Rao"
94
- title = "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M" # rubocop:disable Metrics/LineLength
96
+ title = "Angie’s List Sets Price Range IPO At $11 To $13 Per Share; Valued At Over $600M"
95
97
  expect(@entry["title"]).to eq title
96
98
  end
97
99
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  module Feedjira
@@ -34,7 +36,7 @@ module Feedjira
34
36
  end
35
37
 
36
38
  it "should parse the description" do
37
- description = "TechCrunch is a group-edited blog that profiles the companies, products and events defining and transforming the new web." # rubocop:disable Metrics/LineLength
39
+ description = "TechCrunch is a group-edited blog that profiles the companies, products and events defining and transforming the new web."
38
40
  expect(@feed.description).to eq description
39
41
  end
40
42
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Parser::RSS do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  describe Feedjira::Preprocessor do
@@ -21,9 +23,9 @@ describe Feedjira::Preprocessor do
21
23
  end
22
24
 
23
25
  it "leaves escaped html within pre tag" do
24
- processor = Feedjira::Preprocessor.new(sample_atom_xhtml_with_escpaed_html_in_pre_tag_feed) # rubocop:disable Metrics/LineLength
26
+ processor = Feedjira::Preprocessor.new(sample_atom_xhtml_with_escpaed_html_in_pre_tag_feed)
25
27
  escaped = processor.to_xml
26
- expected_pre_tag = " &lt;pre&gt;&amp;lt;b&amp;gt;test&amp;lt;b&amp;gt;&lt;/pre&gt;" # rubocop:disable Metrics/LineLength
28
+ expected_pre_tag = " &lt;pre&gt;&amp;lt;b&amp;gt;test&amp;lt;b&amp;gt;&lt;/pre&gt;"
27
29
  expect(escaped.split("\n")[7]).to eq(expected_pre_tag)
28
30
  end
29
31
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "spec_helper"
2
4
 
3
5
  RSpec.describe Feedjira do
@@ -62,6 +64,16 @@ RSpec.describe Feedjira do
62
64
  expect(feed.entries.first.id).to eq "23246627"
63
65
  expect(feed.entries.last.id.strip).to eq "1"
64
66
  end
67
+
68
+ it "does not fail if multiple published dates exist and some are unparseable" do
69
+ expect(Feedjira.logger).to receive(:warn).twice
70
+
71
+ feed = Feedjira.parse(sample_invalid_date_format_feed)
72
+ expect(feed.title).to eq "Invalid date format feed"
73
+ published = Time.parse_safely "Mon, 16 Oct 2017 15:10:00 GMT"
74
+ expect(feed.entries.first.published).to eq published
75
+ expect(feed.entries.size).to eq 2
76
+ end
65
77
  end
66
78
 
67
79
  context "when there's no available parser" do
@@ -79,6 +91,15 @@ RSpec.describe Feedjira do
79
91
  expect(feed.entries.first.published).to eq published
80
92
  expect(feed.entries.size).to eq 20
81
93
  end
94
+
95
+ it "should parse an RSS feed with an a10 namespace" do
96
+ feed = Feedjira.parse(sample_rss_feed_with_a10_namespace)
97
+ expect(feed.url).to eq "http://www.example.com/"
98
+ expect(feed.entries.first.url).to eq "http://www.example.com/5"
99
+ expect(feed.entries.first.updated).to eq Time.parse_safely("2020-05-14T10:00:18Z")
100
+ expect(feed.entries.first.author).to eq "John Doe"
101
+ expect(feed.entries.size).to eq 5
102
+ end
82
103
  end
83
104
 
84
105
  describe ".parser_for_xml" do
@@ -128,7 +149,7 @@ RSpec.describe Feedjira do
128
149
  it "does not use default parsers" do
129
150
  xml = "Atom asdf"
130
151
  new_parser = Class.new do
131
- def self.able_to_parse?(_)
152
+ def self.able_to_parse?(_xml)
132
153
  true
133
154
  end
134
155
  end
data/spec/sample_feeds.rb CHANGED
@@ -1,8 +1,10 @@
1
- # rubocop:disable Metrics/LineLength
1
+ # frozen_string_literal: true
2
2
 
3
3
  module SampleFeeds
4
4
  FEEDS = {
5
5
  sample_atom_feed: "AmazonWebServicesBlog.xml",
6
+ sample_atom_simple: "atom_simple_single_entry.xml",
7
+ sample_atom_simple_link_self: "atom_simple_single_entry_link_self.xml",
6
8
  sample_atom_middleman_feed: "FeedjiraBlog.xml",
7
9
  sample_atom_xhtml_feed: "pet_atom.xml",
8
10
  sample_atom_feed_line_breaks: "AtomFeedWithSpacesAroundEquals.xml",
@@ -21,6 +23,7 @@ module SampleFeeds
21
23
  sample_feedburner_atom_feed: "PaulDixExplainsNothing.xml",
22
24
  sample_feedburner_atom_feed_alternate: "GiantRobotsSmashingIntoOtherGiantRobots.xml",
23
25
  sample_feedburner_atom_entry_content: "PaulDixExplainsNothingFirstEntryContent.xml",
26
+ sample_google_alerts_atom_feed: "google_alerts_atom.xml",
24
27
  sample_wfw_feed: "PaulDixExplainsNothingWFW.xml",
25
28
  sample_google_docs_list_feed: "GoogleDocsList.xml",
26
29
  sample_feed_burner_atom_xhtml_feed: "FeedBurnerXHTML.xml",
@@ -29,6 +32,9 @@ module SampleFeeds
29
32
  sample_atom_xhtml_with_escpaed_html_in_pre_tag_feed: "AtomEscapedHTMLInPreTag.xml",
30
33
  sample_json_feed: "json_feed.json",
31
34
  sample_rss_feed_huffpost_ca: "HuffPostCanada.xml",
35
+ sample_invalid_date_format_feed: "InvalidDateFormat.xml",
36
+ sample_rss_feed_permalinks: "Permalinks.xml",
37
+ sample_rss_feed_with_a10_namespace: "a10.xml"
32
38
  }.freeze
33
39
 
34
40
  FEEDS.each do |method, filename|
@@ -39,5 +45,3 @@ module SampleFeeds
39
45
  File.read("#{File.dirname(__FILE__)}/sample_feeds/#{filename}")
40
46
  end
41
47
  end
42
-
43
- # rubocop:enable Metrics/LineLength
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
2
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
3
+
4
+ <channel>
5
+ <title>Invalid date format feed</title>
6
+ <link>http://example.com/feed</link>
7
+ <language>en-US</language>
8
+ <item>
9
+ <title>Item 0 with an invalid date</title>
10
+ <link>http://example.com/item0</link>
11
+ <pubDate>Mon, 16 Oct 2017 15:10:00 +0000</pubDate>
12
+ <dc:date>1518478934</dc:date>
13
+ </item>
14
+ <item>
15
+ <title>Item 1 with all valid dates</title>
16
+ <link>http://example.com/item1</link>
17
+ <pubDate>Tue, 17 Oct 2017 12:17:00 +0000</pubDate>
18
+ <dc:date>Tue, 17 Oct 2017 22:17:00 +0000</dc:date>
19
+ </item>
20
+ </channel>
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <rss version="2.0">
3
+ <channel>
4
+ <item>
5
+ <title>Item 1</title>
6
+ <guid isPermaLink="false">http://example.com/1</guid>
7
+ </item>
8
+ <item>
9
+ <title>Item 2</title>
10
+ <guid isPermaLink="true">http://example.com/2</guid>
11
+ </item>
12
+ <item>
13
+ <title>Item 3</title>
14
+ <guid>http://example.com/3</guid>
15
+ </item>
16
+ <item>
17
+ <title>Item 4</title>
18
+ <link>http://example.com/4</link>
19
+ <guid>http://example.com/5</guid>
20
+ </item>
21
+ </channel>
22
+ </rss>
@@ -0,0 +1,72 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
3
+ <channel>
4
+ <title>Some Title</title>
5
+ <description>Some Description</description>
6
+ <lastBuildDate>Thu, 14 May 2020 10:00:18 Z</lastBuildDate>
7
+ <category>Some Category</category>
8
+ <a10:link href="http://www.example.com/" />
9
+ <pubDate>Sat, 16 May 2020 08:50:40 GMT</pubDate>
10
+ <item>
11
+ <title>Title 5</title>
12
+ <description>Description 5</description>
13
+ <pubDate>Thu, 14 May 2020 10:00:18 Z</pubDate>
14
+ <a10:link href="http://www.example.com/5" />
15
+ <a10:author>
16
+ <a10:name>John Doe</a10:name>
17
+ <a10:uri>http://www.example.com/</a10:uri>
18
+ <a10:email>john.doe@example.com</a10:email>
19
+ </a10:author>
20
+ <a10:updated>2020-05-14T10:00:18Z</a10:updated>
21
+ </item>
22
+ <item>
23
+ <title>Title 4</title>
24
+ <description>Description 4</description>
25
+ <pubDate>Wed, 13 May 2020 10:17:57 Z</pubDate>
26
+ <a10:link href="http://www.example.com/4" />
27
+ <a10:author>
28
+ <a10:name>John Doe</a10:name>
29
+ <a10:uri>http://www.example.com/</a10:uri>
30
+ <a10:email>john.doe@example.com</a10:email>
31
+ </a10:author>
32
+ <a10:updated>2020-05-13T10:17:57Z</a10:updated>
33
+ </item>
34
+ <item>
35
+ <title>Title 3</title>
36
+ <description>Dfescription 3</description>
37
+ <pubDate>Tue, 12 May 2020 15:00:00 Z</pubDate>
38
+ <a10:link href="http://www.example.com/3" />
39
+ <a10:author>
40
+ <a10:name>John Doe</a10:name>
41
+ <a10:uri>http://www.example.com/</a10:uri>
42
+ <a10:email>john.doe@example.com</a10:email>
43
+ </a10:author>
44
+ <a10:updated>2020-05-12T15:00:00Z</a10:updated>
45
+ </item>
46
+ <item>
47
+ <title>Title 2</title>
48
+ <description>Description 2</description>
49
+ <pubDate>Tue, 12 May 2020 07:52:36 Z</pubDate>
50
+ <a10:link href="http://www.example.com/2" />
51
+ <a10:author>
52
+ <a10:name>John Doe</a10:name>
53
+ <a10:uri>http://www.example.com/</a10:uri>
54
+ <a10:email>john.doe@example.com</a10:email>
55
+ </a10:author>
56
+ <a10:updated>2020-05-12T07:52:36Z</a10:updated>
57
+ </item>
58
+ <item>
59
+ <title>Title 1</title>
60
+ <description>Description 1</description>
61
+ <pubDate>Thu, 07 May 2020 07:36:53 Z</pubDate>
62
+ <a10:link href="http://www.example.com/1" />
63
+ <a10:author>
64
+ <a10:name>John Doe</a10:name>
65
+ <a10:uri>http://www.example.com/</a10:uri>
66
+ <a10:email>john.doe@example.com</a10:email>
67
+ </a10:author>
68
+ <a10:updated>2020-05-07T07:36:53Z</a10:updated>
69
+ </item>
70
+ </channel>
71
+ </rss>
72
+