Pubsubhubub to get “POST” response from the hub

Skip to first unread message

Azooz Totti

Dec 9, 2014, 8:12:33 PM12/9/14

I'm trying to use Pubsubhubub to get real time RSS feeds update. I'm using PHP for that purpose.

I subscribed to thenextweb as an example;

$hub_url = "";
$callback_url = "";
$feed = "";
$sub = new Subscriber($hub_url, $callback_url);
$status = $sub->subscribe($feed);

I receive The hub returns code 202, and after that a "GET" response to my callback.php with the hub_challenge and other stuff. I followed what the tutorials suggest of echoing this number, and hence, the hub will be able to push updates to my callback.

if ($method == 'GET' && $_GET['hub_mode'] == 'subscribe') { 
$challenge = $_GET['hub_challenge'];
header('HTTP/1.1 200 "OK"', null, 200);
header('Content-Type: text/plain');
echo $challenge;

That's how I echo the challenge number. The problem here is that I don't get any other messages from the hub even though i have a condition to handle any POST message in my callback.

else if ($method == 'POST') {
$updates = json_decode(file_get_contents("php://input"), true);
//doing stuff with the data here

I'm not sure if the problem is with the echo part or after that. Does anyone have similar issues? what am I doing wrong?

Julien Genestoux

Dec 10, 2014, 3:29:33 AM12/10/14
to Pubsubhubbub
Hum. Let's try with a feed that you can control, such as to which you can publish with
Are you able to subscribe?


You received this message because you are subscribed to the Google Groups "Pubsubhubbub" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit


Dec 10, 2014, 7:07:24 AM12/10/14
Hi Azooz,

Try instead, it should work.

It's unfortunate that it doesn't work with I'll see if we can fix it.

Reply all
Reply to author
0 new messages