Getting Feedburner Subscriber With CURL

Posted by Eray Alakese on Stack Overflow See other posts from Stack Overflow or by Eray Alakese
Published on 2011-01-16T12:14:34Z Indexed on 2011/01/16 12:53 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

I'm using FeedBurner Awareness API. XML data like this :

<rsp stat="ok">
-
<!--
This information is part of the FeedBurner Awareness API. If you want to hide this information, you may do so via your FeedBurner Account.
-->
-
<feed id="9n66llmt1frfir51p0oa367ru4" uri="teknoblogo">
<entry date="2011-01-15" circulation="11" hits="18" reach="0"/>
</feed>
</rsp>

I want to get circulation data (11) . I'm using this code:

$whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=teknoblogo";

//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;
echo "OK";

But, returned data is blank. There isn't any error. Only return OK . How can i solve this ?

EDIT : echo $data; returning blank, too.

© Stack Overflow or respective owner

Related posts about php

Related posts about curl