2010-11-27 81 views
0

第一碼:問題的確認訂閱使用PubSubHubbub

if(isset($_GET["hub_challenge"])) { 
    echo $_GET["hub_challenge"]; 

    } 
    else { 

    } 
    $feeded = $_POST['feed']; 
    $ch = curl_init("http://pubsubhubbub.appspot.com"); 
    curl_setopt($ch, CURLOPT_POST, TRUE); 
    curl_setopt($ch,CURLOPT_POSTFIELDS,"hub.mode=subscribe&hub.verify=async&hub.callback=http://rssreaderbg.net/pubsubbub/example/index.php?url=$feeded&hub.topic=$feeded"); 
    curl_exec($ch); 

的回調代碼:

file_put_contents("logmeme.txt",$HTTP_RAW_POST_DATA,FILE_APPEND); 

https://pubsubhubbub.appspot.com/topic-details?hub.url=http%3A%2F%2Frssreaderbg.net%2Fblog%2F%3Ffeed%3Drss2

https://pubsubhubbub.appspot.com/subscription-details?hub.callback=http%3A%2F%2Frssreaderbg.net%2Fpubsubbub%2Fexample%2Findex.php&hub.topic=http%3A%2F%2Frssreaderbg.net%2Fblog%2F%3Ffeed%3Drss2&hub.secret=

它不能達到回調URL或?

回答

0

在迴應挑戰之前,請嘗試明確地將標頭設置爲2xx。

header('HTTP/1.1 204 "No Content"', true, 204);