1
我用這個代碼:PubSubHubbub通訊錯誤,確認認購
<?php
if(isset($_GET["hub_challenge"])) {
echo $_GET["hub_challenge"];
}
else {
}
$ch = curl_init("http://pubsubhubbub.appspot.com");
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch,CURLOPT_POSTFIELDS,"hub.mode=subscribe&hub.verify=sync&hub.callback=http://rssreaderbg.net/pubsubbub/example/index.php&hub.topic=http://rssreaderbg.net/blog/?feed=comments-rss2");
curl_exec($ch);
file_put_contents("logmeme.txt",$HTTP_RAW_POST_DATA);
?><?php
if(isset($_GET["hub_challenge"])) {
echo $_GET["hub_challenge"];
}
else {
}
$ch = curl_init("http://pubsubhubbub.appspot.com");
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch,CURLOPT_POSTFIELDS,"hub.mode=subscribe&hub.verify=sync&hub.callback=http://rssreaderbg.net/pubsubbub/example/index.php&hub.topic=http://rssreaderbg.net/blog/?feed=comments-rss2");
curl_exec($ch);
file_put_contents("logmeme.txt",$HTTP_RAW_POST_DATA);
?>
但在pubsubhubbub.appspot.com輪轂給了我「錯誤試圖確認訂閱」,爲什麼呢?
我改變類型爲異步,它的工作原理! – lam3r4370 2010-10-23 10:27:01
有一些延遲,我沒有注意到。現在它工作。謝謝! – lam3r4370 2010-10-23 10:53:28