Display FeedBurner Feed Count

<?php
    //get cool feedburner count
    $whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=your 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'];
    echo $fb;
    //end get cool feedburner count
?>

Replace "your feedburner id" with your actual FeedBurner ID. Also, make sure your "Awareness API" is turned on in your FeedBurner settings for the particular feed you are pulling from.

Comments

  1. User Avatar
    hacksch
    Permalink to comment#

    Hello,

    this doesn’t work anymore. The url changed since feedburner is a part of google.
    This request will work with a new url “https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=”.

    Note: you need to activate this service by the feed settings “Publicize > FeedCount”

  2. User Avatar
    Mark Anthony
    Permalink to comment#

    Can you do this on jquery or javascript? thanks!

Submit a Comment

Posting Code

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag