]> git.wh0rd.org - tt-rss.git/commitdiff
pubsubhubbub: use atom rel=self link (when available) when subscribing
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 11 Nov 2013 18:51:20 +0000 (22:51 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 11 Nov 2013 18:52:15 +0000 (22:52 +0400)
to push-enabled feeds

include/rssfuncs.php

index bc6048217f671869e1bceb249231fc291d05cd7d..43c02c7f4a1eb8baf0624e78cf365c74a3f02d9d 100644 (file)
 
                                _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';
 
                                        $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);