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 = "http://pubsubhubbub.appspot.com/";;
$callback_url = "http://xx.com/rss/callback.php";;
$feed = "http://feeds2.feedburner.com/thenextweb";;
$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?

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to