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.
- login your feedburner and go to your feed.
- Go to Publicize tag
- Go to Awareness Api and active it.
<?php
//get cool feedburner count
$toopen="http://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=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;
?>