From 6003daff9dac9dd45c9617420c186b224f7a3102 Mon Sep 17 00:00:00 2001 From: Nicolas Delsaux Date: Sun, 5 Jul 2015 15:51:17 +0200 Subject: [PATCH] fixed a small bug regarding url processing --- bridges/TheOatMealBridge.php | 12 ++++-------- index.php | 5 +++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/bridges/TheOatMealBridge.php b/bridges/TheOatMealBridge.php index da0aab66..413de755 100644 --- a/bridges/TheOatMealBridge.php +++ b/bridges/TheOatMealBridge.php @@ -32,14 +32,13 @@ class TheOatmealBridge extends RssExpander{ protected function parseRSSItem($newsItem) { + $namespaces = $newsItem->getNameSpaces(true); + $dc = $newsItem->children($namespaces['dc']); + $rdf = $newsItem->children($namespaces['rdf']); $item = new Item(); $item->title = trim($newsItem->title); $this->message("browsing Oatmeal item ".var_export($newsItem, true)); - if(empty($newsItem->guid)) { - $item->uri = $newsItem->link; - } else { - $item->uri = $newsItem->guid; - } + $item->uri=$newsItem->attributes($namespaces['rdf'])->about; // now load that uri from cache $this->message("now loading page ".$item->uri); $articlePage = str_get_html($this->get_cached($item->uri)); @@ -50,9 +49,6 @@ class TheOatmealBridge extends RssExpander{ } $item->content = $content->innertext; - $namespaces = $newsItem->getNameSpaces(true); - - $dc = $newsItem->children($namespaces['dc']); $this->message("dc content is ".var_export($dc, true)); $item->name = $dc->creator; $item->timestamp = DateTime::createFromFormat(DateTime::ISO8601, $dc->date)->getTimestamp(); diff --git a/index.php b/index.php index 34c05096..c6b4bbb8 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,8 @@ TODO : date_default_timezone_set('UTC'); error_reporting(0); -//ini_set('display_errors','1'); error_reporting(E_ALL); // For debugging only. +//ini_set('display_errors','1'); +//error_reporting(E_ALL); // For debugging only. // extensions check if (!extension_loaded('openssl')) @@ -220,7 +221,7 @@ $formats = Format::searchInformation();

RSS-Bridge

-

·Reconnecting the Web·

+

·Reconnecting the Web·