Merge branch 'master' of git.tt-rss.org:fox/tt-rss

This commit is contained in:
Andrew Dolgov 2019-03-14 09:08:57 +03:00
commit 4438f27f73
1 changed files with 11 additions and 0 deletions

View File

@ -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;
}