How To Display Feed Count For Google FeedProxy In Text
January 8th, 2009 in Articles, News, WordPress by kailoonEveryone knows that feedburner had merged with Google. This also lead to the previous feed counter in text doesn’t work. I just found out the solution for whoever is using feed counter in text with feedburner before and now converted into Google FeedProxy. Thanks to one of my user of “Our Community” – mtsandeep.
To Display Feedburner Subscriber Count In Text
Copy paste the following code into your template, replace feedburner-id with your Feedbuner username.
//get cool feedburner count $whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=feedburner-id"; //Initialize the Curl session $ch = curl_init(); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set the URL curl_setopt($ch, CURLOPT_URL, $whaturl); //Execute the fetch $data = curl_exec($ch); //Close the connection curl_close($ch); $xml = new SimpleXMLElement($data); $fb = $xml->feed->entry['circulation']; //end get cool feedburner count
Paste this anywhere you want and it’ll display a Feedburner subscriber count in text.
echo $fb;
To Display Feed Counter For Google FeedProxy In Text
Use the previous code. Change this:
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=feedburner-id";
Into This:
$whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=feedburner-id";
Full Code:
//get cool feedburner count $whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=feedburner-id"; //Initialize the Curl session $ch = curl_init(); //Set curl to return the data instead of printing it to the browser. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set the URL curl_setopt($ch, CURLOPT_URL, $whaturl); //Execute the fetch $data = curl_exec($ch); //Close the connection curl_close($ch); $xml = new SimpleXMLElement($data); $fb = $xml->feed->entry['circulation']; //end get cool feedburner count














I’m using this code in this site and it works fine.
use following code from curt init – curl close for ($whaturl=”https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=feedburner-id”;)
$ch = curl_init();
//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Personally I prefer CURLAUTH_ANY as it covers all bases
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
// This is occassionally required to stop CURL from verifying the peer’s certificate.
// CURLOPT_SSL_VERIFYHOST may also need to be TRUE or FALSE if
// CURLOPT_SSL_VERIFYPEER is disabled (it defaults to 2 – check the existence of a
// common name and also verify that it matches the hostname provided)
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $url);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);
https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=feedburner-id
with this link i am not getting curl response