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.
- Facebook Developer Documentation - This is the main Facebook Developer website. It has all kinds of information from a wiki, to tutorials, to getting started guides.
- Facebook PHP Tutorial - This is a great tutorial for beginners. It goes through the very basics of what is needed to begin developing with the Facebook APIs and PHP. It Includes a basic application example.
- Developing with the Facebook Platform and PHP - This is another great tutorial for PHP developers, this time from Sitepoint. It covers the basics and gets a little more in-depth, covering topics like the News Feed and the User Profile Box.
- How to Develop a Hit Facebook App: 29 Essential Tools and Tutorials - This is not a tutorial, but a site that links to 29 useful websites that provide more information to help you in your journey to create the next best Facebook App.
- An Introduction to FBML - This link provides a nice overview to FBML (Facebook Markup Language). It is fairly basic, but an easy read. Definitely recommended when in need of a quick understanding.
- Facebook Developer Tutorials - A good listing of many tutorials covering many different topics. There is a lot of good information here. It is definitely worth checking out.
- How to use the Facebook API - This is a very basic overview of the API. It offers some good information, but is very short and to the point.
- Getting Started with the Facebook Platform API (Screencast) - There are 3 screencasts here that cover the basics of setting up an application through Facebook and writing the code once the application has been set up through the Facebook developer application.
- How To Set Up A Facebook Feed Reader Application For Your Blog - HowtoForge gives a nicely written tutorial on how to create an RSS feed reader application. This is a great tutorial and a great idea. This is a good way to spread the word about your blog in a fairly easily.
- Facebook Development Kit - Here is a development kit released by Microsoft, that includes control and samples for both Visual Basic and Visual C#. The site includes some nice walkthrough videos as well.
What other resources have you used to learn your way through the Facebook API's? Let us know in the comments.