lib/feedzirra/feed.rb in feedzirra-0.1.2 vs lib/feedzirra/feed.rb in feedzirra-0.1.3
- old
+ new
@@ -44,11 +44,11 @@
# Provides a list of registered feed parsing classes.
#
# === Returns
# A array of class names.
def self.feed_classes
- @feed_classes ||= [Feedzirra::Parser::RSSFeedBurner, Feedzirra::Parser::RSS, Feedzirra::Parser::AtomFeedBurner, Feedzirra::Parser::Atom]
+ @feed_classes ||= [Feedzirra::Parser::RSSFeedBurner, Feedzirra::Parser::RSS, Feedzirra::Parser::GoogleDocsAtom, Feedzirra::Parser::AtomFeedBurner, Feedzirra::Parser::Atom, Feedzirra::Parser::ITunesRSS]
end
# Makes all registered feeds types look for the passed in element to parse.
# This is actually just a call to element (a SAXMachine call) in the class.
#
@@ -277,11 +277,11 @@
xml = decode_content(c)
klass = determine_feed_parser_for_xml(xml)
if klass
begin
- feed = klass.parse(xml, Proc.new{|message| puts "Error while parsing [#{url}] #{message}" })
+ feed = klass.parse(xml, Proc.new{|message| warn "Error while parsing [#{url}] #{message}" })
feed.feed_url = c.last_effective_url
feed.etag = etag_from_header(c.header_str)
feed.last_modified = last_modified_from_header(c.header_str)
responses[url] = feed
options[:on_success].call(url, feed) if options.has_key?(:on_success)
@@ -330,11 +330,11 @@
curl.headers["If-None-Match"] = feed.etag if feed.etag
curl.on_success do |c|
begin
add_feed_to_multi(multi, feed_queue.shift, feed_queue, responses, options) unless feed_queue.empty?
- updated_feed = Feed.parse(c.body_str){ |message| puts "Error while parsing [#{feed.feed_url}] #{message}" }
+ updated_feed = Feed.parse(c.body_str){ |message| warn "Error while parsing [#{feed.feed_url}] #{message}" }
updated_feed.feed_url = c.last_effective_url
updated_feed.etag = etag_from_header(c.header_str)
updated_feed.last_modified = last_modified_from_header(c.header_str)
feed.update_from_feed(updated_feed)
responses[feed.feed_url] = feed
@@ -379,6 +379,6 @@
def self.last_modified_from_header(header)
header =~ /.*Last-Modified:\s(.*)\r/
Time.parse($1) if $1
end
end
-end
\ No newline at end of file
+end