From 778bbd8d851bc7cc54913baec476f170978524d1 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 4 Sep 2016 13:38:21 +0200 Subject: [PATCH] [Freenews] Use internal RSS 2.0 parser --- bridges/FreenewsBridge.php | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/bridges/FreenewsBridge.php b/bridges/FreenewsBridge.php index 676a7168..dbc46b9e 100644 --- a/bridges/FreenewsBridge.php +++ b/bridges/FreenewsBridge.php @@ -1,34 +1,22 @@ title); - $this->debugMessage("item has for title \"".$item['title']."\""); - if(empty($newsItem->guid)) { - $item['uri'] = (string) $newsItem->link; - } else { - $item['uri'] = (string) $newsItem->guid; - } - // now load that uri from cache - $this->debugMessage("now loading page ".$item['uri']); + $item = $this->parseRSS_2_0_Item($newsItem); + $articlePage = $this->get_cached($item['uri']); - $content = $articlePage->find('.post-container', 0); $item['content'] = $content->innertext; - $item['author'] = $articlePage->find('a[rel=author]', 0)->innertext; - // format should parse 2014-03-25T16:21:20Z. But, according to http://stackoverflow.com/a/10478469, it is not that simple - $item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem); + return $item; } }