From 63f4ea5f5be426810077acf49967a140053c266d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 10 Jun 2023 09:18:39 +0300 Subject: append when invoking readability --- init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'init.php') diff --git a/init.php b/init.php index 3cfde14..f6ba6e3 100644 --- a/init.php +++ b/init.php @@ -380,7 +380,7 @@ class Af_Lemmy extends Plugin { */ private function readability(array $article, string $url, DOMDocument $doc, DOMXpath $xpath, bool $debug = false) : array { - if (function_exists("curl_init") && mb_strlen(strip_tags($article["content"])) <= 150) { + if (function_exists("curl_init") && !preg_match("/post\/[0-9]{1,}$/", $url) && mb_strlen(strip_tags($article["content"])) <= 200) { /* link may lead to a huge video file or whatever, we need to check content type before trying to parse it which p much requires curl */ @@ -393,7 +393,7 @@ class Af_Lemmy extends Plugin { $this->host->run_hooks_callback(PluginHost::HOOK_GET_FULL_TEXT, function ($result) use (&$article) { if ($result) { - $article["content"] = $result; + $article["content"] .= "
" . $result; return true; } }, -- cgit v1.2.3