summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2023-08-03 07:23:58 +0300
committerAndrew Dolgov <[email protected]>2023-08-03 07:23:58 +0300
commit83bb62633d0f4c129eb5ab69a45365ab5fda3d46 (patch)
tree0b491a1238c32fe23d3f272ba09d60fc80d11f45
parent2de739b757ffb454134f9c2c53074a28a390ff70 (diff)
extract article author badly
-rw-r--r--init.php6
1 files changed, 6 insertions, 0 deletions
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);