Get subscriber count with feedburner API

Today, I want to add feed count from feedburner , in my blog. So, I need to write code using feedburner api. It's not easy.
  1. login your feedburner and go to your feed.
  2. Go to Publicize tag
  3. Go to Awareness Api and active it. Now, time for coding. change your id in uri of $toopen. In the code, I use saturngoden.

$ch = curl_init(); /// initialize a cURL session curl_setopt($ch, CURLOPT_URL, $toopen ); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec ($ch);//end get cool feedburner count curl_close($ch);

$dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->loadXML($content); $count=$dom->getElementsByTagName("entry")->item(0)->getAttribute("circulation"); echo $count; ?>

Tweet
comments powered byDisqus