PubSubHubbub 确认订阅时出错

发布于 2024-09-29 10:26:41 字数 1023 浏览 0 评论 0原文

我使用此代码:

<?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 的中心给我“尝试确认订阅时出错”,为什么?

I use this code:

<?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);


?>

But the hub at pubsubhubbub.appspot.com gives me "Error trying to confirm subscription" ,why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

戏剧牡丹亭 2024-10-06 10:26:41

最简单的解决方案是尝试自己执行订阅验证。
使用规范中所述的参数向您的回调发送 GET 请求。确保您的回调返回 2XX 并且仅回显集线器提供的 hub.challenge

The simplest solution is to try performing a subcription verification yourself.
Send a GET request to your callback with the params as explained in the spec. Make sure your callback returns a 2XX and only echoes the hub.challenge provided by the hub.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文