dongsuiwo0279 2010-10-23 09:52
浏览 34
已采纳

PubSubHubbub错误确认订阅

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?

  • 写回答

1条回答 默认 最新

  • dongzai5181 2010-10-23 10:12
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了