]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/pubsubhubbub/pubsubhubbub.php
Use multi-level routes for existing controllers instead of 1 level everywhere
[github/shaarli/Shaarli.git] / plugins / pubsubhubbub / pubsubhubbub.php
index 184b588b7f44d62b89df0fc2f0e07094da0e8b41..170f34949eb0e7dfadcf099f5014568888b2a7ba 100644 (file)
@@ -6,11 +6,14 @@
  * PubSub is a protocol which fasten up RSS fetching:
  *   - Every time a new link is posted, Shaarli notify the hub.
  *   - The hub notify all feed subscribers that a new link has been posted.
- *   - Subscribers retrieve the new link. 
+ *   - Subscribers retrieve the new link.
  */
 
 use pubsubhubbub\publisher\Publisher;
 use Shaarli\Config\ConfigManager;
+use Shaarli\Feed\FeedBuilder;
+use Shaarli\Plugin\PluginManager;
+use Shaarli\Router;
 
 /**
  * Plugin init function - set the hub to the default appspot one.
@@ -57,8 +60,8 @@ function hook_pubsubhubbub_render_feed($data, $conf)
 function hook_pubsubhubbub_save_link($data, $conf)
 {
     $feeds = array(
-        index_url($_SERVER) .'?do=atom',
-        index_url($_SERVER) .'?do=rss',
+        index_url($_SERVER) .'feed/atom',
+        index_url($_SERVER) .'feed/rss',
     );
 
     $httpPost = function_exists('curl_version') ? false : 'nocurl_http_post';
@@ -82,7 +85,8 @@ function hook_pubsubhubbub_save_link($data, $conf)
  *
  * @throws Exception An error occurred.
  */
-function nocurl_http_post($url, $postString) {
+function nocurl_http_post($url, $postString)
+{
     $params = array('http' => array(
         'method' => 'POST',
         'content' => $postString,