Pubsubhubbub caller callback implementation in PHP

I am trying to use the PSHB protocol to notify me of my Google alerts. I use the code found here . However, it is not clear to me how to implement a callback (or endpoint).

Can someone provide a trivial example showing how I can access the data that POSTed sent to my endpoint?

A (slightly modified) google code snippet is below:

<?php

// simple example for the PHP pubsubhubbub Subscriber
// as defined at http://code.google.com/p/pubsubhubbub/
// written by Josh Fraser | joshfraser.com | josh@eventvue.com
// Released under Apache License 2.0

include("subscriber.php");

$hub_url = "http://pubsubhubbub.appspot.com";
$callback_url = "http://www.example.com/mycallback.php"; // <- how to implement this ?

[[Edit]]

I have added some pseudo-codes below to help clarify the question further ...

// Implementation of mycallback.php
<?php
    $pubsub_post_vars = $_POST[WHAT_NAME_AM_I_LOOKING_FOR]; //what the name of the POST var?
    // How do I get to the 'good stuff?
    $feed_id    = $pubsub_post_vars[SOME_VARIABLE]
    $feed_title = $pubsub_post_vars[ANOTHER_VARIABLE]
    $contents   = $pubsub_post_vars[YET_ANOTHER_VARIABLE]
    $author     = $pubsub_post_vars[YET_ANOTHER_VARIABLE_1]
    $perma_link = $pubsub_post_vars[YET_ANOTHER_VARIABLE_2]
    $pub_date   = $pubsub_post_vars[YET_ANOTHER_VARIABLE_3]
?>

, () , , RSS/ATOM, POSTED. , , , , , ... ..

+5
1

, , . , , , :

hub.challenge, .

, , (), , .

[] , - POST, ( $request_body = @file_get_contents('php://input');). POST PHP . . XML (RSS Atom), .

+2

All Articles