1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 07:45:55 +00:00

plugins: add HOOK_GET_FULL_TEXT which may be used to provide full text extraction to core code and other plugins, instead of trying to invoke af_readability specifically

This commit is contained in:
Andrew Dolgov
2019-04-17 08:32:35 +03:00
parent 525298569e
commit 6955b2e02d
3 changed files with 24 additions and 1 deletions

View File

@@ -100,7 +100,7 @@ class Article extends Handler_Protected {
$pluginhost->load_all(PluginHost::KIND_ALL, $owner_uid);
$pluginhost->load_data();
$af_readability = $pluginhost->get_plugin("Af_Readability");
/*$af_readability = $pluginhost->get_plugin("Af_Readability");
if ($af_readability) {
$enable_share_anything = $pluginhost->get($af_readability, "enable_share_anything");
@@ -110,6 +110,15 @@ class Article extends Handler_Protected {
if ($extracted_content) $content = $extracted_content;
}
}*/
foreach ($pluginhost->get_hooks(PluginHost::HOOK_GET_FULL_TEXT) as $p) {
$extracted_content = $p->hook_get_full_text($url);
if ($extracted_content) {
$content = $extracted_content;
break;
}
}
}