开发者

Getting Feedburner Subscriber With CURL

开发者 https://www.devze.com 2023-02-04 06:43 出处:网络
I\'m using FeedBurner Awa开发者_如何学JAVAreness API. XML data like this : <rsp stat=\"ok\">

I'm using FeedBurner Awa开发者_如何学JAVAreness 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消