lib/feedjira/parser/rss.rb in feedjira-3.1.1 vs lib/feedjira/parser/rss.rb in feedjira-3.1.2
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Feedjira
module Parser
# Parser for dealing with RSS feeds.
# Source: https://cyber.harvard.edu/rss/rss.html
class RSS
@@ -8,19 +10,20 @@
element :description
element :image, class: RSSImage
element :language
element :lastBuildDate, as: :last_built
element :link, as: :url
+ element :"a10:link", as: :url, value: :href
element :rss, as: :version, value: :version
element :title
element :ttl
elements :"atom:link", as: :hubs, value: :href, with: { rel: "hub" }
elements :item, as: :entries, class: RSSEntry
attr_accessor :feed_url
def self.able_to_parse?(xml)
- (/\<rss|\<rdf/ =~ xml) && !(/feedburner/ =~ xml)
+ (/<rss|<rdf/ =~ xml) && !(/feedburner/ =~ xml)
end
end
end
end