From 83bb62633d0f4c129eb5ab69a45365ab5fda3d46 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 3 Aug 2023 07:23:58 +0300 Subject: extract article author badly --- init.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'init.php') diff --git a/init.php b/init.php index b126535..79b22da 100644 --- a/init.php +++ b/init.php @@ -278,6 +278,12 @@ class Af_Lemmy extends Plugin { array_push($categories, $link->textContent); } + $submitted_by = $xpath->query('//a[contains(@href, "/u/")]')->item(0); + + if ($submitted_by) { + $article["author"] = $submitted_by->textContent; + } + array_push($article["tags"], ...FeedItem_Common::normalize_categories($categories)); $found = $this->inline_stuff($article, $doc, $xpath, $origin_domain); -- cgit v1.2.3