add politis cover

This commit is contained in:
quenousimporte 2024-09-05 14:08:19 +02:00
parent 9a52832348
commit ee0f2fe47c
1 changed files with 8 additions and 0 deletions

View File

@ -422,6 +422,14 @@
$epub->epub_file = 'epub/politis' . $issuenb . '.epub'; $epub->epub_file = 'epub/politis' . $issuenb . '.epub';
$epub->title = 'Politis ' . $issuenb . ' - RSS ' . $today; $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 // load feeds
$feed = file_get_contents($feedurl); $feed = file_get_contents($feedurl);
$xml = new SimpleXMLElement($feed); $xml = new SimpleXMLElement($feed);