diff options
author | Andrew Dolgov <[email protected]> | 2013-11-11 22:51:20 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-11-11 22:52:15 +0400 |
commit | d8179cb9d927bb1bd3e1bed76a3c0cfaf43fd122 (patch) | |
tree | 914b88471f29c9c324f34b9b60cdc4f2db596241 /include/rssfuncs.php | |
parent | cb868cbe84602fe88b4215f994c44e6c94d12ca8 (diff) |
pubsubhubbub: use atom rel=self link (when available) when subscribing
to push-enabled feeds
Diffstat (limited to 'include/rssfuncs.php')
-rw-r--r-- | include/rssfuncs.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php index bc6048217..43c02c7f4 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -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); |