我正在使用FeedBurner感知API。这样的XML数据:
<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>我想得到循环数据(11)。我用的是这个代码:
$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";但是,返回的数据是空白的。没有任何错误。只返回OK。我怎么才能解决这个问题?
编辑:回显$data;也返回空白。
发布于 2011-01-16 12:45:46
你试过使用http而不是https吗?
对于这种情况,我认为使用http不会有任何问题。
一些网络主机提供商和一些服务器已经禁用了cURL的SSL。
您可能希望look at this question有关使用cURL + SSL。
https://stackoverflow.com/questions/4705263
复制相似问题