Add subscribe hook, give more information to fetch_feed hook
This commit is contained in:
parent
a283bf2643
commit
01465325b4
|
@ -41,6 +41,7 @@ class PluginHost {
|
||||||
const HOOK_HOUSE_KEEPING = 24;
|
const HOOK_HOUSE_KEEPING = 24;
|
||||||
const HOOK_SEARCH = 25;
|
const HOOK_SEARCH = 25;
|
||||||
const HOOK_FORMAT_ENCLOSURES = 26;
|
const HOOK_FORMAT_ENCLOSURES = 26;
|
||||||
|
const HOOK_SUBSCRIBE_FEED = 27;
|
||||||
|
|
||||||
const KIND_ALL = 1;
|
const KIND_ALL = 1;
|
||||||
const KIND_SYSTEM = 2;
|
const KIND_SYSTEM = 2;
|
||||||
|
|
|
@ -1687,6 +1687,10 @@
|
||||||
return array("code" => 5, "message" => $fetch_last_error);
|
return array("code" => 5, "message" => $fetch_last_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) {
|
||||||
|
$contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass);
|
||||||
|
}
|
||||||
|
|
||||||
if (is_html($contents)) {
|
if (is_html($contents)) {
|
||||||
$feedUrls = get_feeds_from_html($url, $contents);
|
$feedUrls = get_feeds_from_html($url, $contents);
|
||||||
|
|
||||||
|
|
|
@ -268,7 +268,7 @@
|
||||||
$force_refetch = isset($_REQUEST["force_refetch"]);
|
$force_refetch = isset($_REQUEST["force_refetch"]);
|
||||||
|
|
||||||
foreach ($pluginhost->get_hooks(PluginHost::HOOK_FETCH_FEED) as $plugin) {
|
foreach ($pluginhost->get_hooks(PluginHost::HOOK_FETCH_FEED) as $plugin) {
|
||||||
$feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed);
|
$feed_data = $plugin->hook_fetch_feed($feed_data, $fetch_url, $owner_uid, $feed, $last_article_timestamp, $auth_login, $auth_pass);
|
||||||
}
|
}
|
||||||
|
|
||||||
// try cache
|
// try cache
|
||||||
|
|
Loading…
Reference in New Issue