I have a project I’m working on that a user can submit an RSS Feed with his blog submission.
I need to check this RSS Feed and make sure it’s valid before I let the submission go through. How do I do this??
I found this class, but it doesn’t work for me at all:
I also found this, but the reply is vague and doesn’t help me:
Any help would be GREATLY appreciated!!
simplexml_load_string returns false on errors, maybe that will do the trick.
Personally, I would validate the RSS using an external resource / service / API.
Say for example, we had this feed from Ebay:-
I would use cURL to obtain the page generated from this URL
If within that source we had the string “This is a valid RSS feed” , Bingo!
Just some random thinking and putting it out there.
That’s what my first example used, but it didn’t work… do you know of any sample code that would help me out?
I appreciate the quick responses!
function validateFeed( $sFeedURL )
$sValidator = 'http://feedvalidator.org/check.cgi?url=';
if( $sValidationResponse = @file_get_contents($sValidator . urlencode($sFeedURL)) )
if( stristr( $sValidationResponse , 'This is a valid RSS feed' ) !== false )