From 5fdfa0fff1c53b60afa73384487da17aa228ca77 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 22 Aug 2024 14:23:30 +0200 Subject: [PATCH] add option to include mp cold articles from home fix article date --- epub.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/epub.php b/epub.php index d004a04..1ad81ba 100644 --- a/epub.php +++ b/epub.php @@ -408,7 +408,13 @@ $doc->loadHTML($home); $finder = new DomXPath($doc); - $links = $finder->query('//section[contains(@class, "_hot")]//a[not(contains(@href, "/dossier/")) and not(contains(@href, "/studio/")) and not(contains(@href, "fil-")) and (@href != "/journal/series")]/@href'); + $coldcondition = '[contains(@class, "_hot")]'; + if (isset($_POST['mpcold']) && $_POST['mpcold']) + { + $coldcondition = '[contains(@class, "_cold") or contains(@class, "_hot")]'; + } + + $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'); foreach ($links as $link) { @@ -421,7 +427,7 @@ $title = $finder->query('//h1')->item(0)->textContent; $author = $finder->query('//a[contains(@href, "biographie")]')->item(0)->textContent; - $date = $finder->query('//time')->item(0)->textContent; + $date = $finder->query('//time')->item(1)->textContent; $summary = $finder->query('//p[contains(@class, "news__heading__top__intro")]')->item(0)->textContent; // strip images @@ -656,6 +662,9 @@
+ + +