PSD to HTML conversion PSD to HTML conversion PSD2HTML.com with over 300 professionals takes the designs to HTML and beyond

Code Snippet

Home » Code Snippets » PHP » Get FeedBurner Subscriber Count with cURL

Get FeedBurner Subscriber Count with cURL

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'https://feedburner.google.com/api/awareness/1.0/GetFeedData?id=7qkrmib4r9rscbplq5qgadiiq4');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,2);
$content = curl_exec($ch);
$subscribers = get_match('/circulation="(.*)"/isU',$content);
curl_close($ch);

The $subscribers variable will then be your subscriber count, for echoing out (or whatever). You'll need to replace the ID at the end of the second line with your feed's ID (find it). You'll also need to have the Awareness feature of FeedBurner enabled.

Subscribe to The Thread

  1. SubSONiK says:

    I used the above code with my id:

    but i get an error message like this:

    Fatal error: Call to undefined function get_match() in /home/boom/public_html/subscribers.php on line 14

    my id is valid, checked the xml file: https://feedburner.google.com/api/awareness/1.0/GetFeedData?id=c0plc3tf94g80eaqavodrdsgvg

    Is it a webhosting issue maybe? My server supports PHP Version 5.2.6

    Thanx!

    • I think that function probably needs to be defined elsewhere…

      function get_match($regex,$content)
      {
        preg_match($regex,$content,$matches);
        return $matches[1];
      }
  2. SubSONiK says:

    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,’https://feedburner.google.com/api/awareness/1.0/GetFeedData?id=c0plc3tf94g80eaqavodrdsgvg‘);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,2);
    $content = curl_exec($ch);
    $subscribers = get_match(‘/circulation=”(*)”/isU’,$content);
    curl_close($ch);

  3. Nice information! It can be used with images and CSS to produce great result…

Speak, my friend

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
~ The Management ~