0

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.

Eray
  • 7,038
  • 16
  • 70
  • 120

1 Answers1

0

Have you tried using http instead of https?

For this case, I don't think that there will be any problems using http.

Some web hosting providers and some servers have SSL disabled for cURL.

You might want to look at this question about using cURL + SSL.

Community
  • 1
  • 1
Thai
  • 10,746
  • 2
  • 45
  • 57
  • Thank you. But still same problem . – Eray Jan 16 '11 at 12:48
  • Actually, it worked for me (`https`). You may have to check if the server can access the resource or not. – Thai Jan 16 '11 at 12:55
  • Can you try a `print_r` of `curl_getinfo`? – Thai Jan 16 '11 at 15:23
  • added this code **print_r(curl_getinfo($ch));** , nothing returned. BUT code start working. It returning 11 . I'm deleting **print_r(curl_getinfo($ch));** code but still working :D I can't understand . My problem is solved for now, but i can't understand how solved. – Eray Jan 16 '11 at 19:51