:on_success handler failure

33 views
Skip to first unread message

dwilde1

unread,
Feb 29, 2012, 10:06:27 AM2/29/12
to feedzirra, pa...@pauldix.net
Paul,

I updated my code to try and take advantage of your new
(0.1.2) :on_success/:on_failure handler, but I always got
the :on_failure branch even though I'm getting 200 codes back. I had
to back it out.

def test_rss_feed( characteristics )
new_characteristics = Hash.new
feed =
Feedzirra::Feed.fetch_and_parse( characteristics['source_url'],

:on_success => lambda { | feed |
puts " Good feed!"
new_characteristics = process_good_rss_feed( feed,
characteristics ) },

:on_failure => lambda { | url,
response_code,
response_header,
response_body |
puts " Bad Feed"
new_characteristics = process_bad_rss_feed( url,

response_code,

response_header,

response_body,

characteristics ) } )
return new_characteristics
end

<eom>
Reply all
Reply to author
Forward
0 new messages