1

私はこのコードを使用します:

<?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のハブから、「サブスクリプションの確認中にエラーが発生しました」と表示されるのはなぜですか。

4

1 に答える 1

1

最も簡単な解決策は、自分でサブスクリプション検証を実行してみることです。仕様で説明されているように、パラメータを使用してGETリクエストをコールバックに送信します。hub.challengeコールバックが2XXを返し、ハブによって提供されたものだけをエコーすることを確認してください。

于 2010-10-23T10:12:26.287 に答える