]> git.wh0rd.org Git - tt-rss.git/commitdiff
af_comics: Allow subscribing to GoComics URLs via page (only this time, *actually...
authorDave Z <donotreply@example.com>
Wed, 7 Feb 2018 06:52:36 +0000 (06:52 +0000)
committerDave Z <donotreply@example.com>
Wed, 7 Feb 2018 06:52:36 +0000 (06:52 +0000)
plugins/af_comics/init.php

index 66c48fcf50c7ac286334d17ebaed948ec133e2ce..255ae72392f4cbe5d9162c00b16b94c550c263f5 100755 (executable)
@@ -14,6 +14,7 @@ class Af_Comics extends Plugin {
                $this->host = $host;
 
                $host->add_hook($host::HOOK_FETCH_FEED, $this);
+               $host->add_hook($host::HOOK_SUBSCRIBE_FEED, $this);
                $host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
                $host->add_hook($host::HOOK_PREFS_TAB, $this);
 
@@ -151,6 +152,16 @@ class Af_Comics extends Plugin {
                return $feed_data;
        }
 
+       function hook_subscribe_feed($contents, $url, $auth_login, $auth_pass) {
+               if ($auth_login || $auth_pass)
+                       return $contents;
+
+               if (preg_match('#^https?://www\.gocomics\.com/([-a-z0-9]+)$#i', $url))
+                       return '<?xml version="1.0" encoding="utf-8"?>'; // Get is_html() to return false.
+
+               return $contents;
+       }
+
        function api_version() {
                return 2;
        }