I’m currently using this code to get the number of subscribers to my blog:
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=http://feeds.feedburner.com/DesignDeluge";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $whaturl);
$data = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];
but when I echo $fb it doesn’t work (the whole file that $fb is being echoed on doesn’t appear). Any ideas on why this isn’t working?
If you take a look at
$databefore trying to load it with SimpleXMLElement, you’ll see it contains the following portion of HTML code :So, there’s no way you’ll find what you’re looking for in there 😉
A solution could be to use the
CURLOPT_FOLLOWLOCATIONoption (seecurl_setopt), so curl follows redirections…… But this doesn’t seem to work either.
Actually, when I try to load the URL that’s given in the portion of HTML code I posted earlier :
I only get the following XML as return :
Are you sure you are using the right URLs / feeds ?