title: Any existing RSS feed url validators?
body: <p>Before I dive into writing a validator to check if a URL is actually pointing to an RSS feed, I did a bit of searching for some validators that may exist out there but had little luck with any reliable ones.</p>
  
  <p>I just wanted to ask the community if any of you know of an RSS validator by URL?</p>
  
  <p>If I were to write my own, what do you suggest?</p>
  
  <p>I was thinking of just checking for the first instance of a line of text and making sure it defines <code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</code> and then perhaps checking that the next item is an <code>&lt;rss&gt;</code> node.</p>
  
  <p>What are your thoughts here? Could there ever be a case where a feed may not follow the syntax stated above?</p>
  
  <p>Also note, one method I attempted to use was the following:</p>
  
  <pre><code>$valid = true;
  
  try{
      $content = file_get_contents($feed);
      if (!simplexml_load_string($content)){
          $valid = false;
      }
  } catch (Exception $e){
      $valid = false;
  }
  </code></pre>
  
  <p>Unfortunately it seems that I cannot suppress warnings (<code>error_reporting(0)</code> is not working..) so the just spams me with warnings.</p>
  
  <hr>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>For anyone that is interested, I used the W3C Validator API</p>
  
  <pre><code>$url = "http://feed_url.com";
  $validator = "http://validator.w3.org/feed/check.cgi";
  $validator .= "?url=".$url;
  $validator .= "&amp;output=soap12";
  
  $response = file_get_contents($validator);
  $a = strpos($response, '&lt;m:validity&gt;', 0)+12; 
  $b = strpos($response, '&lt;/m:validity&gt;', $a); 
  $result = substr($response, $a, $b-$a); 
  echo $result;
  </code></pre>
  
  <p>This will return true or false accordingly.</p>