AndyJarrett Code. Develop. Manage.

isValidRss CFC

Update: This project is now hosted on GitHub @ was mucking around last night after finding out my feed wasnt valid, and created a validation CFC.The code is simple, but its just an idea if anyone wants to play around with it. It returns a boolean result,so i was thinking if it returns TRUE, then display "valid rss image" else "invalid, please email webmaster"?Here's the code for it, or if you want you can download it

<cfcomponent displayname="Check if valid RSS feed" hint="I take a URL and check it against ATOM to see if it is valid">
   <cffunction name="isValidRss" access="public" returntype="string" displayname="isValidRss" hint="I check an RSS Feed to see if its valid">
      <cfset var validationResult = FALSE>
      <cfargument name="rssUrl" type="string" required="true">
      <!--- Go of and validate the feed --->

      <cfif findNoCase("Congratulations!", cfhttp.FileContent)>
         <cfset validationResult = TRUE>
      <cfreturn validationResult>

I’m here, learning and working away. If you liked this content and want to keep me going, consider buying me a coffee.
Your support keeps this site running and the coffee brewing! ☕️