How To Get Your FeedBurner Circulation With One Simple Function

If you have visited a few blogs then I am sure you have seen the FeedBurner stats graphic. The count is very useful, but the graphic itself isn't very appealing, even with the ability to customize it. Thankfully the FeedBurner API was released, which allows you to retrieve your stats without the graphic. I have taken that API and created a simple function, with the help of simple XML, to grab your circulation count and display it as text on your site without the graphic.

To start off, you will need to download the simple XML class and put it in the same folder as the file that will contain this function (or change the include path to reflect the directory of your choice). Once you have done that, you are pretty much done. All you need to do is copy the function below and call the function with your feed URI and it will return the circulation number.

You can see the function and sample usage below.

Function

function FeedBurnerCirc($feed) {
include 'simplexml.class.php';
$api = 'http://api.feedburner.com/awareness/1.0/GetFeedData?uri='.$feed;
$sxml = new simplexml;
$sxml->ignore_level = 1;
$data = $sxml->xml_load_file($api,"array");
return $data["entry"]["@attributes"]["circulation"];
}

Usage

echo FeedBurnerCirc('http://feeds.feedburner.com/webmastersbydesign');

You could also easily customize the function to include more data and return an array of results. The API returns data other that the circulation, such as your reach and views. I only wanted the circulation so I didn't return an array of results, but it wouldn't be tough to do.

10 Great Facebook Developer Resources

Facebook just recently celebrated their one year anniversary for the release of their developer platform. The API was released on May 28, 2007 and has exploded with user applications since then. The application directory has tens of thousands of applications, some with over 1.5 million daily users. For those of you, like me, who may not have jumped on the bandwagon right away, here are some great tutorials and information to get you started now.

What other resources have you used to learn your way through the Facebook API's? Let us know in the comments.