pubsubhubbub: use atom rel=self link (when available) when subscribing

to push-enabled feeds
This commit is contained in:
Andrew Dolgov 2013-11-11 22:51:20 +04:00
parent cb868cbe84
commit d8179cb9d9
1 changed files with 15 additions and 2 deletions

View File

@ -502,7 +502,20 @@
_debug("feed hub url: $feed_hub_url", $debug_enabled);
if ($feed_hub_url && function_exists('curl_init') &&
$feed_self_url = $fetch_url;
$links = $rss->get_links('self');
if ($links && is_array($links)) {
foreach ($links as $l) {
$feed_self_url = $l;
break;
}
}
_debug("feed self url = $feed_self_url");
if ($feed_hub_url && $feed_self_url && function_exists('curl_init') &&
!ini_get("open_basedir")) {
require_once 'lib/pubsubhubbub/subscriber.php';
@ -512,7 +525,7 @@
$s = new Subscriber($feed_hub_url, $callback_url);
$rc = $s->subscribe($fetch_url);
$rc = $s->subscribe($feed_self_url);
_debug("feed hub url found, subscribe request sent.", $debug_enabled);