0

Can someone tell me how can I get the feedburner subscribers count as text using php? I am trying the following, but it does not work as I think feedburner has changed the contents of the xml file. Thanks for any help.

$whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=USERNAME";
$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'];
echo $fb;

1 Answers1

0

Need to alter line 7 to:

$fb = $xml->feed->entry->attributes()->circulation;

//Much later edit

I actually have a couple of posts on my blog by now with code for fetching facebook / twitter / feedburner counts. Code with APC caching is here:http://www.glowingminds.co.uk/facebook-likes-twitter-follows-and-feedburner-count-in-php-with-curlsimplexml-deluxe/

Ingmar Boddington
  • 3,440
  • 19
  • 38