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 = '
' . $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 @@