From 21daa9e42698724517fa3cb3e85fbf18b621bd09 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Fri, 23 Aug 2024 09:31:16 +0200 Subject: [PATCH] simplify mp home xpath, more inclusive --- epub.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/epub.php b/epub.php index 1ad81ba..fb9c2c8 100644 --- a/epub.php +++ b/epub.php @@ -408,13 +408,9 @@ $doc->loadHTML($home); $finder = new DomXPath($doc); - $coldcondition = '[contains(@class, "_hot")]'; - if (isset($_POST['mpcold']) && $_POST['mpcold']) - { - $coldcondition = '[contains(@class, "_cold") or contains(@class, "_hot")]'; - } + $xpath = '//a[@data-js = "teaser-link" and contains(@href, "/journal/") and not(contains(@href, "/dossier/")) and not(contains(@href, "/studio/")) and not(contains(@href, "fil-")) and (@href != "/journal/series")]/@href'; - $links = $finder->query('//section' . $coldcondition . '//a[not(contains(@href, "/dossier/")) and not(contains(@href, "/studio/")) and not(contains(@href, "fil-")) and (@href != "/journal/series")]/@href'); + $links = $finder->query($xpath); foreach ($links as $link) { @@ -662,9 +658,6 @@
- - -