[bridges] Fix all calls from 'message' to 'debugMessage'

This commit is contained in:
logmanoriginal 2016-08-24 20:19:30 +02:00
parent 8252387386
commit 5a7bc9b0c3
5 changed files with 17 additions and 17 deletions

View file

@ -21,14 +21,14 @@ class FreenewsBridge extends RssExpander {
protected function parseRSSItem($newsItem) {
$item = array();
$item['title'] = trim($newsItem->title);
$this->message("item has for title \"".$item['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->message("now loading page ".$item['uri']);
$this->debugMessage("now loading page ".$item['uri']);
$articlePage = str_get_html($this->get_cached($item['uri']));
$content = $articlePage->find('.post-container', 0);

View file

@ -28,7 +28,7 @@ class GawkerBridge extends RssExpander{
$this->name = $param['site'];
$url = $this->toURI(strtolower($param['site']));
}
$this->message("loading feed from ".$this->getURI());
$this->debugMessage("loading feed from ".$this->getURI());
parent::collectExpandableDatas($param, $url);
}
@ -37,10 +37,10 @@ class GawkerBridge extends RssExpander{
$item['uri'] = trim($newsItem->link);
$item['title'] = trim($newsItem->title);
$item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem);
$this->message("///////////////////////////////////////////////////////////////////////////////////////\nprocessing item ".var_export($item, true)."\n\n\nbuilt from\n\n\n".var_export($newsItem, true));
$this->debugMessage("///////////////////////////////////////////////////////////////////////////////////////\nprocessing item ".var_export($item, true)."\n\n\nbuilt from\n\n\n".var_export($newsItem, true));
try {
// now load that uri from cache
$this->message("loading page ".$item['uri']);
$this->debugMessage("loading page ".$item['uri']);
$articlePage = str_get_html($this->get_cached($item['uri']));
if(is_object($articlePage)) {
$content = $articlePage->find('.post-content', 0);
@ -51,14 +51,14 @@ class GawkerBridge extends RssExpander{
$item['author'] = $authorLink->innertext;
// TODO use author link href to fill the feed info
}
$this->message("item quite loaded : ".var_export($item, true));
$this->debugMessage("item quite loaded : ".var_export($item, true));
// I set item content as last element, for easier var_export reading
$item['content'] = $content->innertext;
} else {
throw new Exception("cache content for ".$item['uri']." is NOT a Simple DOM parser object !");
}
} catch(Exception $e) {
$this->message("obtaining ".$item['uri']." resulted in exception ".$e->getMessage().". Deleting cached page ...");
$this->debugMessage("obtaining ".$item['uri']." resulted in exception ".$e->getMessage().". Deleting cached page ...");
// maybe file is incorrect. it should be discarded from cache
$this->remove_from_cache($item['url']);
$item['content'] = $e->getMessage();

View file

@ -21,14 +21,14 @@ class Les400CulsBridge extends RssExpander{
protected function parseRSSItem($newsItem) {
$item = array();
$item['title'] = trim((string) $newsItem->title);
$this->message("browsing item ".var_export($newsItem, true));
$this->debugMessage("browsing item ".var_export($newsItem, true));
if(empty($newsItem->guid)) {
$item['uri'] = (string) $newsItem->link;
} else {
$item['uri'] = (string) $newsItem->guid;
}
// now load that uri from cache
$this->message("now loading page ".$item['uri']);
$this->debugMessage("now loading page ".$item['uri']);
// $articlePage = str_get_html($this->get_cached($item['uri']));
// $content = $articlePage->find('.post-container', 0);

View file

@ -24,10 +24,10 @@ class TheOatmealBridge extends RssExpander{
protected function collect_RSS_2_0_data($rssContent) {
$rssContent->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/");
$rssHeaderContent = $rssContent->channel[0];
$this->message("RSS content is ===========\n".var_export($rssHeaderContent, true)."===========");
$this->debugMessage("RSS content is ===========\n".var_export($rssHeaderContent, true)."===========");
$this->load_RSS_2_0_feed_data($rssHeaderContent);
foreach($rssContent->item as $item) {
$this->message("parsing item ".var_export($item, true));
$this->debugMessage("parsing item ".var_export($item, true));
$this->items[] = $this->parseRSSItem($item);
}
}
@ -39,10 +39,10 @@ class TheOatmealBridge extends RssExpander{
$rdf = $newsItem->children($namespaces['rdf']);
$item = array();
$item['title'] = trim($newsItem->title);
$this->message("browsing Oatmeal item ".var_export($newsItem, true));
$this->debugMessage("browsing Oatmeal item ".var_export($newsItem, true));
$item['uri']=(string) $newsItem->attributes($namespaces['rdf'])->about;
// now load that uri from cache
$this->message("now loading page ".$item['uri']);
$this->debugMessage("now loading page ".$item['uri']);
$articlePage = str_get_html($this->get_cached($item['uri']));
$content = $articlePage->find('#comic', 0);
@ -51,10 +51,10 @@ class TheOatmealBridge extends RssExpander{
}
$item['content'] = $content->innertext;
$this->message("dc content is ".var_export($dc, true));
$this->debugMessage("dc content is ".var_export($dc, true));
$item['author'] = (string) $dc->creator;
$item['timestamp'] = DateTime::createFromFormat(DateTime::ISO8601, $dc->date)->getTimestamp();
$this->message("writtem by ".$item['author']." on ".$item['timestamp']);
$this->debugMessage("writtem by ".$item['author']." on ".$item['timestamp']);
return $item;
}

View file

@ -45,7 +45,7 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{
$this->uri = WORLD_OF_TANKS.$this->lang.NEWS.'pc-browser/'.$param['category']."/";
}
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request '.$this->getURI());
$this->message("loaded HTML from ".$this->getURI());
$this->debugMessage("loaded HTML from ".$this->getURI());
// customize name
$this->name = $html->find('title', 0)->innertext;
foreach($html->find('.b-imgblock_ico') as $infoLink) {
@ -57,7 +57,7 @@ class WorldOfTanksBridge extends HttpCachingBridgeAbstract{
$item = array();
$item['uri'] = WORLD_OF_TANKS.$infoLink->href;
// now load that uri from cache
$this->message("loading page ".$item['uri']);
$this->debugMessage("loading page ".$item['uri']);
$articlePage = str_get_html($this->get_cached($item['uri']));
$content = $articlePage->find('.l-content', 0);
HTMLSanitizer::defaultImageSrcTo($content, WORLD_OF_TANKS);