Neil Cauldwell
2008-Nov-24 07:43 UTC
Catching non-RSS/Atom feeds when using Feed-Normalizer
A production app is using FeedNormalizer in an rss daemon. The worker opens a ''Source'' (the apps naming convention for an RSS feed), parses it using FeedNormalizer, and does the business on the items in the feed; feed = FeedNormalizer::FeedNormalizer.parse open(source.rss_url) A beta tester added a URL, rather than an RSS/Atom URL, and the worker choked (on screen prompts have since been cleared up, but that''s not enough). I see two options, but I don''t know how to implement either; 1) Validate against anything that isn''t RSS/Atom, or one of the recognised ''feed'' formats which we can parse using feednormalizer Or, the better option from a usability perspective, 2) The RSS worker catches any errors when FeedNormalizer tries to open the source.rss_url, and, if it isn''t an RSS URL, tries to find any RSS feed associated with the ''source.rss_url'' the user provided. I''m happy to go with the first option (as a stop-gap) if someone knows of a regex which can be used to validate against a non-feed url (my limited experience with rss formats suggests this is unlikely). If you think I should go with the second option, I can probably work out how to catch the errors from FN but it would be great to know if anyone has a snippet for taking a URL and attempting to find a feed on it. Any suggestions? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Neil Cauldwell
2008-Nov-27 13:08 UTC
Re: Catching non-RSS/Atom feeds when using Feed-Normalizer
No thoughts on this one? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---