diff options
author | Andrew Dolgov <[email protected]> | 2019-03-14 09:08:57 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-03-14 09:08:57 +0300 |
commit | 4438f27f7399cc63cda8c743f29886968194dcae (patch) | |
tree | 6ff57c2c807ef2291a457e6ba3d78782c2b05409 /plugins/af_comics/init.php | |
parent | b1bb7c6001c9a2c7c636674c110ccfdd5a09cd7e (diff) | |
parent | e0dabf318b135f0b13a23e98de8f035f2723a520 (diff) |
Merge branch 'master' of git.tt-rss.org:fox/tt-rss
Diffstat (limited to 'plugins/af_comics/init.php')
-rwxr-xr-x | plugins/af_comics/init.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php index a46933305..d24287c74 100755 --- a/plugins/af_comics/init.php +++ b/plugins/af_comics/init.php @@ -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_FEED_BASIC_INFO, $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); @@ -166,6 +167,16 @@ class Af_Comics extends Plugin { return $contents; } + function hook_feed_basic_info($basic_info, $fetch_url, $owner_uid, $feed, $auth_login, $auth_pass) { + if ($auth_login || $auth_pass) + return $basic_info; + + if (preg_match('#^https?://www\.gocomics\.com/([-a-z0-9]+)$#i', $fetch_url, $matches)) + $basic_info = array('title' => ucfirst($matches[1]), 'site_url' => $matches[0]); + + return $basic_info; + } + function api_version() { return 2; } |