phpcountsubscriptionfeedburner

How to fetch Feedburner RSS Feed subscribers count in PHP & WordPress


I have been using a WordPress based PHP function for quite a while now to retrieve the Feedburner subscriber count to be able to display the subscriber count as text.

Here is the function:

/**
 * Fetch Feedburner RSS Feed Subscribers.
 *
 * @param string $feed The feed to fetch.
 * @return int of Feedburner RSS subscribers.
 */
public function get_feedburner_subcribers($feedburner_username){
    $xml = wp_remote_get('http://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=' .$feedburner_username);

    if(is_wp_error($xml))
        return false;

    try {
        $sxe = @new SimpleXMLElement($xml['body']);
    }
    catch (Exception $e) {
        // SimpleXMLElement::__construct produces an E_WARNING error message for
        // each error found in the XML data and throws an exception if errors
        // were detected. Catch any exception and return failure (NULL).
        return;
    }

    return self::format(intval($sxe->feed->entry['circulation']));
}

All was working great until recently when the function no longer returns any value.

If I directly paste the URL http://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=my-feedburner-id I get a Google Error 404 page.

Has Google changed things again and if so is there any other way to retrieve the Feedburner count?

Thanks


Solution

  • The Feedburner API is no longer available. It was shut down on 20 October 2012 (more detail here, including the shutdown date.)