#\r
# License:: MIT license\r
\r
-require 'rss/parser'\r
-require 'rss/1.0'\r
-require 'rss/2.0'\r
-require 'rss/dublincore'\r
-# begin\r
-# require 'rss/dublincore/2.0'\r
-# rescue\r
-# warning "Unable to load RSS libraries, RSS plugin functionality crippled"\r
-# end\r
+# require 'rss/parser'\r
+# require 'rss/1.0'\r
+# require 'rss/2.0'\r
+# require 'rss/dublincore'\r
+# # begin\r
+# # require 'rss/dublincore/2.0'\r
+# # rescue\r
+# # warning "Unable to load RSS libraries, RSS plugin functionality crippled"\r
+# # end\r
+#\r
+# GB: Let's just go for the simple stuff:\r
+#\r
+require 'rss'\r
\r
class ::RssBlob\r
attr_accessor :url\r
report_problem("reading feed #{feed} failed", nil, m)\r
return nil\r
end\r
+ # Ok, 0.9 feeds are not supported, maybe because\r
+ # Netscape happily removed the DTD. So what we do is just to\r
+ # reassign the 0.9 RDFs to 1.0, and hope it goes right.\r
+ xml.gsub!("xmlns=\"http://my.netscape.com/rdf/simple/0.9/\"",\r
+ "xmlns=\"http://purl.org/rss/1.0/\"")\r
feed.mutex.synchronize do\r
feed.xml = xml\r
end\r
begin\r
## do validate parse\r
rss = RSS::Parser.parse(xml)\r
- debug "parsed #{feed}"\r
+ debug "parsed and validated #{feed}"\r
rescue RSS::InvalidRSSError\r
## do non validate parse for invalid RSS 1.0\r
begin\r
rss = RSS::Parser.parse(xml, false)\r
+ debug "parsed but not validated #{feed}"\r
rescue RSS::Error => e\r
report_problem("parsing rss stream failed, whoops =(", e, m)\r
return nil\r