I am trying to use the PSHB protocol to be notified of my Google alerts. I am using the code found here. However, it is not clear to me how to implement the callback (or endpoint).
Can someone provide a trivial example that shows how I can access the data that has been POSTed to my endpoint?
A (slightly modified) snippet of the google code follows 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 pseudocode below, to help clarify the question further ...
// Implementation of mycallback.php
<?php
$pubsub_post_vars = $_POST[WHAT_NAME_AM_I_LOOKING_FOR]; //what's 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]
?>
I realize that approach (above) may be complete wrong, as I suspect that it is an RSS/ATOM document that is POSTed. However, some skeleton code like the one above should be enough to get me started, so that I can extract things like the feed id, title and published content ... etc.