pubsubhubbub - discovery and notifier

This commit is contained in:
Mike Macgirvin 2010-09-30 20:24:03 -07:00
parent abe6a3286e
commit 465ba71b58
4 changed files with 17 additions and 1 deletions

View file

@ -123,11 +123,16 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
$atom = ''; $atom = '';
$hub = get_config('system','huburl');
$hubxml = ((strlen($hub)) ? '<link rel="hub" href="' . xmlify($hub) . '" />' . "\n" : '');
$atom .= replace_macros($feed_template, array( $atom .= replace_macros($feed_template, array(
'$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick), '$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
'$feed_title' => xmlify($owner['name']), '$feed_title' => xmlify($owner['name']),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) , '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
'$hub' => $hubxml,
'$name' => xmlify($owner['name']), '$name' => xmlify($owner['name']),
'$profile_page' => xmlify($owner['url']), '$profile_page' => xmlify($owner['url']),
'$photo' => xmlify($owner['photo']), '$photo' => xmlify($owner['photo']),

View file

@ -83,6 +83,8 @@
else else
killme(); killme();
$hub = get_config('system','huburl');
if($cmd != 'mail') { if($cmd != 'mail') {
require_once('include/group.php'); require_once('include/group.php');
@ -138,11 +140,14 @@
$atom = ''; $atom = '';
$hubxml = ((strlen($hub)) ? '<link rel="hub" href="' . xmlify($hub) . '" />' . "\n" : '');
$atom .= replace_macros($feed_template, array( $atom .= replace_macros($feed_template, array(
'$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner['nickname'] ), '$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner['nickname'] ),
'$feed_title' => xmlify($owner['name']), '$feed_title' => xmlify($owner['name']),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) , '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
'$hub' => $hubxml,
'$name' => xmlify($owner['name']), '$name' => xmlify($owner['name']),
'$profile_page' => xmlify($owner['url']), '$profile_page' => xmlify($owner['url']),
'$photo' => xmlify($owner['photo']), '$photo' => xmlify($owner['photo']),
@ -297,5 +302,10 @@
} }
} }
if((strlen($hub)) && ($cmd !== 'mail') && (followup == false)) {
$params = array('hub.mode' => 'publish', 'hub.url' => $a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
post_url($hub,$params);
}
killme(); killme();

View file

@ -104,7 +104,7 @@ function pubsub_post(&$a) {
consume_feed($xml,$importer,$contact); consume_feed($xml,$importer,$contact);
hub_post_return();; hub_post_return();
} }

View file

@ -10,6 +10,7 @@
<title>$feed_title</title> <title>$feed_title</title>
<generator uri="http://mistpark.com" version="2.0">Mistpark</generator> <generator uri="http://mistpark.com" version="2.0">Mistpark</generator>
<link rel="license" href="http://creativecommons.org/licenses/by/3.0/" /> <link rel="license" href="http://creativecommons.org/licenses/by/3.0/" />
$hub
<updated>$feed_updated</updated> <updated>$feed_updated</updated>