aboutsummaryrefslogtreecommitdiffstats
path: root/mod/pubsub.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-01 02:28:06 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-01 02:28:06 -0700
commitf5615068ca338153ab7dacf5c9ce46c6ed7b1ab4 (patch)
tree3a115617468d12b11877d38ce3f3c415c59981d7 /mod/pubsub.php
parent2ae38e3fbffe2f51fc1dc56e398625e3cebb667c (diff)
downloadvolse-hubzilla-f5615068ca338153ab7dacf5c9ce46c6ed7b1ab4.tar.gz
volse-hubzilla-f5615068ca338153ab7dacf5c9ce46c6ed7b1ab4.tar.bz2
volse-hubzilla-f5615068ca338153ab7dacf5c9ce46c6ed7b1ab4.zip
trialing pubsubhubbub - operational tweaks
Diffstat (limited to 'mod/pubsub.php')
-rw-r--r--mod/pubsub.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/mod/pubsub.php b/mod/pubsub.php
index fa092049f..1feb80031 100644
--- a/mod/pubsub.php
+++ b/mod/pubsub.php
@@ -33,11 +33,13 @@ function pubsub_init(&$a) {
if($_SERVER['REQUEST_METHOD'] === 'GET') {
- $hub_mode = notags(trim($_GET['hub.mode']));
- $hub_topic = notags(trim($_GET['hub.topic']));
- $hub_challenge = notags(trim($_GET['hub.challenge']));
- $hub_lease = notags(trim($_GET['hub.lease_seconds']));
- $hub_verify = notags(trim($_GET['hub.verify_token']));
+ $hub_mode = notags(trim($_GET['hub_mode']));
+ $hub_topic = notags(trim($_GET['hub_topic']));
+ $hub_challenge = notags(trim($_GET['hub_challenge']));
+ $hub_lease = notags(trim($_GET['hub_lease_seconds']));
+ $hub_verify = notags(trim($_GET['hub_verify_token']));
+
+
$subscribe = (($hub_mode === 'subscribe') ? 1 : 0);
@@ -47,6 +49,7 @@ function pubsub_init(&$a) {
if(! count($r))
hub_return(false, '');
+
$owner = $r[0];
$sql_extra = ((strlen($hub_verify)) ? sprintf(" AND `hub-verify` = '%s' ", dbesc($hub_verify)) : '');
@@ -82,6 +85,10 @@ function pubsub_post(&$a) {
$xml = file_get_contents('php://input');
+ $debugging = get_config('system','debugging');
+ if($debugging)
+ file_put_contents('pubsub.out',$xml);
+
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
@@ -103,6 +110,9 @@ function pubsub_post(&$a) {
$contact = $r[0];
$feedhub = '';
+
+ require_once('include/items.php');
+
consume_feed($xml,$importer,$contact,$feedhub);
hub_post_return();