Hi all, I want my users to be able to view RSS feeds of their choice on my site. But i''d like to be able to check the files they are submitting as feeds are actually XML before attempting to parse and display them. I''ve been using feed tools to display the contents of feeds which works perfectly, but i''d like some way to check if a file is a feed/xml. Any pointers in trhe right direction welcome. (I was thinking about opening the remote file, reading the first x bytes and testing for the xml declaration) Thanks -- Posted via http://www.ruby-forum.com/.
Cant you just chekc if feedtools chokes om them??? in that case its not a proper feed format... On Friday, March 17, 2006, at 12:17 PM, dave flynn wrote:>Hi all, >I want my users to be able to view RSS feeds of their choice on my site. >But i''d like to be able to check the files they are submitting as feeds >are actually XML before attempting to parse and display them. >I''ve been using feed tools to display the contents of feeds which works >perfectly, but i''d like some way to check if a file is a feed/xml. > >Any pointers in trhe right direction welcome. > >(I was thinking about opening the remote file, reading the first x bytes >and testing for the xml declaration) > >Thanks > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsMikkel Bruun www.strongside.dk - Football Portal(DK) nflfeed.helenius.org - Football News(DK) ting.minline.dk - Buy Old Stuff!(DK) -- Posted with http://DevLists.com. Sign up and save your time!
Thanks for the reply made me go and have a proper look at the feedtools API, feedtools doesn''t seem to choke, it just doesn''t display anything if it''s not a feed. I went with loading the feed then testing if @feed.feed_type == nil Cheers Mikkel Bruun wrote:> Cant you just chekc if feedtools chokes om them??? in that case its not > a proper feed format... > > > On Friday, March 17, 2006, at 12:17 PM, dave flynn wrote: >>and testing for the xml declaration) >> >>Thanks >> >>-- >>Posted via http://www.ruby-forum.com/. >>_______________________________________________ >>Rails mailing list >>Rails@lists.rubyonrails.org >>http://lists.rubyonrails.org/mailman/listinfo/rails > > > Mikkel Bruun > > www.strongside.dk - Football Portal(DK) > nflfeed.helenius.org - Football News(DK) > ting.minline.dk - Buy Old Stuff!(DK)-- Posted via http://www.ruby-forum.com/.