From b97f7302050673a24ade5e419bf63fbe588c6a7c Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 26 Aug 2024 18:10:14 +0200 Subject: [PATCH] prepare mp refactor home and rss --- epub.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/epub.php b/epub.php index 26475c0..7274400 100644 --- a/epub.php +++ b/epub.php @@ -17,6 +17,11 @@ require 'settings.php'; require 'TPEpubCreator.php'; + function add_mp_article($url, $context, $epub) + { + + } + function get_mp_cookie() { global $mp_user; @@ -325,17 +330,18 @@ foreach ($items as $item) { - $title = $item->title; + $url = $item->link; - $category = $item->xpath('dc:subject')[0]; - $author = $item->xpath('dc:creator')[0]; - $summary = $item->description; - - $article = file_get_contents($item->link, false, $context); + $article = file_get_contents($url, false, $context); $doc = new DOMDocument(); $doc->loadHTML($article); $finder = new DomXPath($doc); + $title = $item->title; + $author = $item->xpath('dc:creator')[0]; + $date = $item->pubDate; + $summary = $item->description; + // strip images $toremove = $finder->query('//svg'); foreach ($toremove as $elt) @@ -355,7 +361,7 @@ $result = '

' . $title . '

'; $result .= '

' . $author . '

'; - $result .= '

' . $item->pubDate . '

'; + $result .= '

' . $date . '

'; $result .= '

' . $summary . '

'; $nodes = $finder->query('//div[contains(@class, "paywall-restricted-content")]'); @@ -501,8 +507,6 @@ foreach ($items as $item) { $title = $item->title; - - $category = $item->xpath('dc:subject')[0]; $author = $item->xpath('dc:creator')[0]; $summary = $item->description; @@ -662,7 +666,7 @@
- +