From ee0f2fe47c3b0b301cef31ba2282a303cefc2027 Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Thu, 5 Sep 2024 14:08:19 +0200 Subject: [PATCH] add politis cover --- epub.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/epub.php b/epub.php index 1ab6535..161c607 100644 --- a/epub.php +++ b/epub.php @@ -422,6 +422,14 @@ $epub->epub_file = 'epub/politis' . $issuenb . '.epub'; $epub->title = 'Politis ' . $issuenb . ' - RSS ' . $today; + // find cover + $issues = file_get_contents('https://www.politis.fr/boutique/magazines-unite/'); + $doc = new DOMDocument(); + $doc->loadHTML($issues); + $finder = new DomXPath($doc); + $cover = $finder->query('//img[contains(@src, "' . $issuenb . '_")]')->item(0)->getAttribute('src'); + $epub->AddImage($cover, 'image/jpeg', true); + // load feeds $feed = file_get_contents($feedurl); $xml = new SimpleXMLElement($feed);