Merge pull request #340 from LogMANOriginal/HarmonizeFormats

Harmonize formats
This commit is contained in:
Mitsu 2016-08-09 17:55:59 +02:00 committed by GitHub
commit 9f3e7e1da7
78 changed files with 198 additions and 294 deletions

View file

@ -112,9 +112,7 @@ The `Item` class is used to store parameter that are collected in the [`collectD
```PHP ```PHP
$item->uri // URI to reach the subject ("http://...") $item->uri // URI to reach the subject ("http://...")
$item->thumbnailUri // URI for the thumbnail ("http://...")
$item->title // Title of the item $item->title // Title of the item
$item->name // Name of the item
$item->timestamp // Timestamp of the item in numeric format (use strtotime) $item->timestamp // Timestamp of the item in numeric format (use strtotime)
$item->author // Name of the author $item->author // Name of the author
$item->content // Content in HTML format $item->content // Content in HTML format
@ -138,9 +136,7 @@ The following list provides an overview of the parameters used by the other form
Parameter | ATOM | HTML | (M)RSS Parameter | ATOM | HTML | (M)RSS
----------|------|------|------- ----------|------|------|-------
`uri`|X|X|X `uri`|X|X|X
`thumbnailUri`||X
`title`|X|X|X `title`|X|X|X
`name`|X||
`timestamp`|X|X|X `timestamp`|X|X|X
`author`|X|X|X `author`|X|X|X
`content`|X|X|X `content`|X|X|X

View file

@ -9,7 +9,7 @@ class ABCTabsBridge extends BridgeAbstract{
$this->name = "ABC Tabs Bridge"; $this->name = "ABC Tabs Bridge";
$this->uri = "http://www.abc-tabs.com/"; $this->uri = "http://www.abc-tabs.com/";
$this->description = "Returns 22 newest tabs"; $this->description = "Returns 22 newest tabs";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -21,7 +21,7 @@ class ABCTabsBridge extends BridgeAbstract{
foreach ($table->find('tr') as $tab) foreach ($table->find('tr') as $tab)
{ {
$item = new \Item(); $item = new \Item();
$item->name = $tab->find('td', 1)->plaintext . ' - ' . $tab->find('td', 2)->plaintext; $item->author = $tab->find('td', 1)->plaintext . ' - ' . $tab->find('td', 2)->plaintext;
$item->title = $tab->find('td', 1)->plaintext . ' - ' . $tab->find('td', 2)->plaintext; $item->title = $tab->find('td', 1)->plaintext . ' - ' . $tab->find('td', 2)->plaintext;
$item->content = 'Le ' . $tab->find('td', 0)->plaintext . '<br> Par: ' . $tab->find('td', 5)->plaintext . '<br> Type: ' . $tab->find('td', 3)->plaintext; $item->content = 'Le ' . $tab->find('td', 0)->plaintext . '<br> Par: ' . $tab->find('td', 5)->plaintext . '<br> Type: ' . $tab->find('td', 3)->plaintext;
$item->id = 'http://www.abc-tabs.com' . $tab->find('td', 2)->find('a', 0)->getAttribute('href'); $item->id = 'http://www.abc-tabs.com' . $tab->find('td', 2)->find('a', 0)->getAttribute('href');

View file

@ -9,7 +9,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
$this->name = 'Anime-Ultime'; $this->name = 'Anime-Ultime';
$this->uri = 'http://www.anime-ultime.net/'; $this->uri = 'http://www.anime-ultime.net/';
$this->description = 'Returns the 10 newest releases posted on Anime-Ultime'; $this->description = 'Returns the 10 newest releases posted on Anime-Ultime';
$this->update = '2015-10-30'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -86,7 +86,6 @@ class AnimeUltimeBridge extends BridgeAbstract {
$item_link_element = $release->find('td', 0)->find('a', 0); $item_link_element = $release->find('td', 0)->find('a', 0);
$item_uri = $website.$item_link_element->href; $item_uri = $website.$item_link_element->href;
$item_name = html_entity_decode($item_link_element->plaintext); $item_name = html_entity_decode($item_link_element->plaintext);
$item_image = $website.substr($item_link_element->onmouseover, 37, strpos($item_link_element->onmouseover, ' ', 37) - 37);
$item_episode = html_entity_decode(str_pad($release->find('td', 1)->plaintext, 2, '0', STR_PAD_LEFT)); $item_episode = html_entity_decode(str_pad($release->find('td', 1)->plaintext, 2, '0', STR_PAD_LEFT));
$item_fansub = $release->find('td', 2)->plaintext; $item_fansub = $release->find('td', 2)->plaintext;
$item_type = $release->find('td', 4)->plaintext; $item_type = $release->find('td', 4)->plaintext;
@ -108,7 +107,6 @@ class AnimeUltimeBridge extends BridgeAbstract {
$item->title = $item_name.' '.$item_type.' '.$item_episode; $item->title = $item_name.' '.$item_type.' '.$item_episode;
$item->author = $item_fansub; $item->author = $item_fansub;
$item->timestamp = $item_date; $item->timestamp = $item_date;
$item->thumbnailUri = $item_image;
$item->content = $item_description; $item->content = $item_description;
$this->items[] = $item; $this->items[] = $item;
$processedOK++; $processedOK++;

View file

@ -9,7 +9,7 @@ class ArstechnicaBridge extends BridgeAbstract {
$this->name = "ArstechnicaBridge"; $this->name = "ArstechnicaBridge";
$this->uri = "http://arstechnica.com"; $this->uri = "http://arstechnica.com";
$this->description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion"; $this->description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion";
$this->update = "01/08/2016"; $this->update = "2016-08-09";
} }
@ -51,7 +51,6 @@ class ArstechnicaBridge extends BridgeAbstract {
$item = new \Item(); $item = new \Item();
$item->title = StripCDATA($element->find('title', 0)->innertext); $item->title = StripCDATA($element->find('title', 0)->innertext);
$item->uri = StripCDATA($element->find('guid', 0)->plaintext); $item->uri = StripCDATA($element->find('guid', 0)->plaintext);
$item->thumbnailUri = StripCDATA($element->find('enclosure', 0)->url);
$item->author = StripCDATA($element->find('author', 0)->innertext); $item->author = StripCDATA($element->find('author', 0)->innertext);
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
$item->content = ExtractContent($item->uri); $item->content = ExtractContent($item->uri);

View file

@ -7,7 +7,7 @@ class Arte7Bridge extends BridgeAbstract{
$this->name = "Arte +7"; $this->name = "Arte +7";
$this->uri = "http://www.arte.tv/"; $this->uri = "http://www.arte.tv/";
$this->description = "Returns newest videos from ARTE +7"; $this->description = "Returns newest videos from ARTE +7";
$this->update = "2015-10-31"; $this->update = "2016-08-09";
$this->parameters["Catégorie (Français)"] = $this->parameters["Catégorie (Français)"] =
'[ '[
{ {
@ -147,12 +147,11 @@ class Arte7Bridge extends BridgeAbstract{
$hack_broadcast_time = strtok($hack_broadcast_time, 'T'); $hack_broadcast_time = strtok($hack_broadcast_time, 'T');
$hack_broadcast_time = strtok('T'); $hack_broadcast_time = strtok('T');
$item->timestamp = strtotime($element['scheduled_on'].'T'.$hack_broadcast_time); $item->timestamp = strtotime($element['scheduled_on'].'T'.$hack_broadcast_time);
$item->thumbnailUri = $element['thumbnail_url'];
$item->title = $element['title']; $item->title = $element['title'];
if (!empty($element['subtitle'])) if (!empty($element['subtitle']))
$item->title = $element['title'].' | '.$element['subtitle']; $item->title = $element['title'].' | '.$element['subtitle'];
$item->duration = round((int)$element['duration']/60); $item->duration = round((int)$element['duration']/60);
$item->content = $element['teaser'].'<br><br>'.$item->duration.'min<br><a href="'.$item->uri.'"><img src="' . $item->thumbnailUri . '" /></a>'; $item->content = $element['teaser'].'<br><br>'.$item->duration.'min<br><a href="'.$item->uri.'"><img src="' . $element['thumbnail_url'] . '" /></a>';
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -9,7 +9,7 @@ class BandcampBridge extends BridgeAbstract{
$this->name = "Bandcamp Tag"; $this->name = "Bandcamp Tag";
$this->uri = "http://bandcamp.com/"; $this->uri = "http://bandcamp.com/";
$this->description = "New bandcamp release by tag"; $this->description = "New bandcamp release by tag";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -38,7 +38,7 @@ class BandcampBridge extends BridgeAbstract{
$uri = rtrim($uri, "')"); $uri = rtrim($uri, "')");
$item = new \Item(); $item = new \Item();
$item->name = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext; $item->author = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext;
$item->title = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext; $item->title = $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext;
$item->content = '<img src="' . $uri . '"/><br/>' . $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext; $item->content = '<img src="' . $uri . '"/><br/>' . $release->find('div.itemsubtext',0)->plaintext . ' - ' . $release->find('div.itemtext',0)->plaintext;
$item->id = $release->find('a',0)->getAttribute('href'); $item->id = $release->find('a',0)->getAttribute('href');

View file

@ -7,7 +7,7 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{
$this->name = "Blagues De Merde"; $this->name = "Blagues De Merde";
$this->uri = "http://www.blaguesdemerde.fr/"; $this->uri = "http://www.blaguesdemerde.fr/";
$this->description = "Blagues De Merde"; $this->description = "Blagues De Merde";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -26,7 +26,7 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{
$date = $element->find("li.bdm_date",0)->innertext; $date = $element->find("li.bdm_date",0)->innertext;
$time = mktime(0, 0, 0, substr($date, 3, 2), substr($date, 0, 2), substr($date, 6, 4)); $time = mktime(0, 0, 0, substr($date, 3, 2), substr($date, 0, 2), substr($date, 6, 4));
$item->timestamp = $time; $item->timestamp = $time;
$item->name = $element->find("li.bdm_pseudo",0)->innertext;; $item->author = $element->find("li.bdm_pseudo",0)->innertext;;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class BooruprojectBridge extends BridgeAbstract{
$this->name = "Booruproject"; $this->name = "Booruproject";
$this->uri = "http://booru.org/"; $this->uri = "http://booru.org/";
$this->description = "Returns images from given page and booruproject instance (****.booru.org)"; $this->description = "Returns images from given page and booruproject instance (****.booru.org)";
$this->update = "2015-09-12"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -51,10 +51,9 @@ class BooruprojectBridge extends BridgeAbstract{
$item->uri = 'http://'.$param['i'].'.booru.org/'.$element->find('a', 0)->href; $item->uri = 'http://'.$param['i'].'.booru.org/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->find('a', 0)->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->find('a', 0)->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('title'); $item->tags = $element->find('img', 0)->getAttribute('title');
$item->title = 'Booruproject '.$param['i'].' | '.$item->postid; $item->title = 'Booruproject '.$param['i'].' | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $element->find('img', 0)->src . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -9,7 +9,7 @@ class CNETBridge extends BridgeAbstract {
$this->name = 'CNET News'; $this->name = 'CNET News';
$this->uri = 'http://www.cnet.com/'; $this->uri = 'http://www.cnet.com/';
$this->description = 'Returns the newest articles. <br /> You may specify a topic found in some section URLs, else all topics are selected.'; $this->description = 'Returns the newest articles. <br /> You may specify a topic found in some section URLs, else all topics are selected.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -59,7 +59,6 @@ class CNETBridge extends BridgeAbstract {
$article_title = trim($element->find('h2', 0)->plaintext); $article_title = trim($element->find('h2', 0)->plaintext);
$article_uri = 'http://www.cnet.com'.($element->find('a', 0)->href); $article_uri = 'http://www.cnet.com'.($element->find('a', 0)->href);
$article_thumbnail = $element->parent()->find('img', 0)->src;
$article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext); $article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext);
$article_author = trim($element->find('a[rel=author]', 0)->plaintext); $article_author = trim($element->find('a[rel=author]', 0)->plaintext);
@ -67,20 +66,10 @@ class CNETBridge extends BridgeAbstract {
$article_html = $this->file_get_html($article_uri) or $this->returnError('Could not request CNET: '.$article_uri, 500); $article_html = $this->file_get_html($article_uri) or $this->returnError('Could not request CNET: '.$article_uri, 500);
if (is_null($article_thumbnail))
$article_thumbnail = $article_html->find('div.originalImage', 0);
if (is_null($article_thumbnail))
$article_thumbnail = $article_html->find('span.imageContainer', 0);
if (is_object($article_thumbnail))
$article_thumbnail = $article_thumbnail->find('img', 0)->src;
$article_content = trim(CleanArticle(ExtractFromDelimiters($article_html, '<div class="articleContent', '<footer>'))); $article_content = trim(CleanArticle(ExtractFromDelimiters($article_html, '<div class="articleContent', '<footer>')));
$item = new \Item(); $item = new \Item();
$item->uri = $article_uri; $item->uri = $article_uri;
$item->thumbnailUri = $article_thumbnail;
$item->title = $article_title; $item->title = $article_title;
$item->author = $article_author; $item->author = $article_author;
$item->timestamp = $article_timestamp; $item->timestamp = $article_timestamp;

View file

@ -24,7 +24,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
$this->name = "Cpasbien Bridge"; $this->name = "Cpasbien Bridge";
$this->uri = "http://www.cpasbien.io"; $this->uri = "http://www.cpasbien.io";
$this->description = "Returns latest torrents from a request query"; $this->description = "Returns latest torrents from a request query";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -57,7 +57,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
$htmlepisode=content_get_html($this->get_cached($episode->find('a', 0)->getAttribute('href'))); $htmlepisode=content_get_html($this->get_cached($episode->find('a', 0)->getAttribute('href')));
$item = new \Item(); $item = new \Item();
$item->name = $episode->find('a', 0)->text(); $item->author = $episode->find('a', 0)->text();
$item->title = $episode->find('a', 0)->text(); $item->title = $episode->find('a', 0)->text();
$item->timestamp = $this->get_cached_time($episode->find('a', 0)->getAttribute('href')); $item->timestamp = $this->get_cached_time($episode->find('a', 0)->getAttribute('href'));
$textefiche=$htmlepisode->find('#textefiche', 0)->find('p',1); $textefiche=$htmlepisode->find('#textefiche', 0)->find('p',1);
@ -70,7 +70,6 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
$item->id = $episode->find('a', 0)->getAttribute('href'); $item->id = $episode->find('a', 0)->getAttribute('href');
$item->uri = $this->uri . $htmlepisode->find('#telecharger',0)->getAttribute('href'); $item->uri = $this->uri . $htmlepisode->find('#telecharger',0)->getAttribute('href');
$item->thumbnailUri = $htmlepisode->find('#bigcover', 0)->find('img',0)->getAttribute('src');
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -9,7 +9,7 @@ class DailymotionBridge extends BridgeAbstract{
$this->name = "Dailymotion Bridge"; $this->name = "Dailymotion Bridge";
$this->uri = "https://www.dailymotion.com/"; $this->uri = "https://www.dailymotion.com/";
$this->description = "Returns the 5 newest videos by username/playlist or search"; $this->description = "Returns the 5 newest videos by username/playlist or search";
$this->update = "2016-08-02"; $this->update = "2016-08-09";
$this->parameters["By username"] = $this->parameters["By username"] =
'[ '[
@ -83,10 +83,9 @@ class DailymotionBridge extends BridgeAbstract{
$item->id = str_replace('/video/', '', strtok($element->href, '_')); $item->id = str_replace('/video/', '', strtok($element->href, '_'));
$metadata = getMetadata($item->id); $metadata = getMetadata($item->id);
$item->uri = $metadata['uri']; $item->uri = $metadata['uri'];
$item->thumbnailUri = $metadata['thumbnailUri'];
$item->title = $metadata['title']; $item->title = $metadata['title'];
$item->timestamp = $metadata['timestamp']; $item->timestamp = $metadata['timestamp'];
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>'; $item->content = '<a href="' . $item->uri . '"><img src="' . $metadata['thumbnailUri'] . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>';
$this->items[] = $item; $this->items[] = $item;
$count++; $count++;
} }

View file

@ -7,7 +7,7 @@ class DanbooruBridge extends BridgeAbstract{
$this->name = "Danbooru"; $this->name = "Danbooru";
$this->uri = "http://donmai.us/"; $this->uri = "http://donmai.us/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -37,10 +37,10 @@ class DanbooruBridge extends BridgeAbstract{
$item->uri = 'http://donmai.us'.$element->find('a', 0)->href; $item->uri = 'http://donmai.us'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = 'http://donmai.us'.$element->find('img', 0)->src; $thumbnailUri = 'http://donmai.us'.$element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('alt'); $item->tags = $element->find('img', 0)->getAttribute('alt');
$item->title = 'Danbooru | '.$item->postid; $item->title = 'Danbooru | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class DemoBridge extends BridgeAbstract{
$this->name = "DemoBridge"; $this->name = "DemoBridge";
$this->uri = "http://github.com/sebsauvage/rss-bridge"; $this->uri = "http://github.com/sebsauvage/rss-bridge";
$this->description = "Bridge used for demos"; $this->description = "Bridge used for demos";
$this->update = "2015-11-03"; $this->update = "2016-08-09";
$this->parameters['testCheckbox'] = $this->parameters['testCheckbox'] =
'[ '[
@ -54,12 +54,11 @@ class DemoBridge extends BridgeAbstract{
public function collectData(array $param){ public function collectData(array $param){
$item = new \Item(); $item = new \Item();
$item->name = "TestElement"; $item->author = "Me!";
$item->title = "Test"; $item->title = "Test";
$item->content = "Awesome content !"; $item->content = "Awesome content !";
$item->id = "Lalala"; $item->id = "Lalala";
$item->uri = "http://test.test/test"; $item->uri = "http://test.test/test";
$item->enclosures[] = "http://www.ardmediathek.de/ard/servlet/image/00/32/68/18/38/1135274624/16x9/960";
$this->items[] = $item; $this->items[] = $item;

View file

@ -7,7 +7,7 @@ class DilbertBridge extends BridgeAbstract {
$this->name = 'Dilbert Daily Strip'; $this->name = 'Dilbert Daily Strip';
$this->uri = 'http://dilbert.com'; $this->uri = 'http://dilbert.com';
$this->description = 'The Unofficial Dilbert Daily Comic Strip'; $this->description = 'The Unofficial Dilbert Daily Comic Strip';
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -29,7 +29,6 @@ class DilbertBridge extends BridgeAbstract {
$item = new \Item(); $item = new \Item();
$item->uri = $url; $item->uri = $url;
$item->thumbnailUri = $comic;
$item->title = $title; $item->title = $title;
$item->author = 'Scott Adams'; $item->author = 'Scott Adams';
$item->timestamp = $date; $item->timestamp = $date;

View file

@ -7,7 +7,7 @@ class DollbooruBridge extends BridgeAbstract{
$this->name = "Dollbooru"; $this->name = "Dollbooru";
$this->uri = "http://dollbooru.org/"; $this->uri = "http://dollbooru.org/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2015-01-20"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
@ -40,10 +40,10 @@ class DollbooruBridge extends BridgeAbstract{
$item->uri = 'http://dollbooru.org'.$element->href; $item->uri = 'http://dollbooru.org'.$element->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-post-id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-post-id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = 'http://dollbooru.org'.$element->find('img', 0)->src; $thumbnailUri = 'http://dollbooru.org'.$element->find('img', 0)->src;
$item->tags = $element->getAttribute('data-tags'); $item->tags = $element->getAttribute('data-tags');
$item->title = 'Dollbooru | '.$item->postid; $item->title = 'Dollbooru | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -6,7 +6,7 @@ class ElsevierBridge extends BridgeAbstract{
$this->name = 'Elsevier journals recent articles'; $this->name = 'Elsevier journals recent articles';
$this->uri = 'http://www.journals.elsevier.com'; $this->uri = 'http://www.journals.elsevier.com';
$this->description = 'Returns the recent articles published in Elsevier journals'; $this->description = 'Returns the recent articles published in Elsevier journals';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -69,7 +69,7 @@ class ElsevierBridge extends BridgeAbstract{
$item = new \Item(); $item = new \Item();
$item->uri = $article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y'; $item->uri = $article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y';
$item->title = $article->find('.pod-listing-header>a',0)->plaintext; $item->title = $article->find('.pod-listing-header>a',0)->plaintext;
$item->name = $this->ExtractArticleName($article); $item->author = $this->ExtractArticleName($article);
$item->timestamp = $this->ExtractArticleTimestamp($article); $item->timestamp = $this->ExtractArticleTimestamp($article);
$item->content = $this->ExtractArticleContent($article); $item->content = $this->ExtractArticleContent($article);
$this->items[] = $item; $this->items[] = $item;

View file

@ -6,7 +6,7 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
$this->name = 'Est-ce qu\'on met en prod aujourd\'hui ?'; $this->name = 'Est-ce qu\'on met en prod aujourd\'hui ?';
$this->uri = 'https://www.estcequonmetenprodaujourdhui.info/'; $this->uri = 'https://www.estcequonmetenprodaujourdhui.info/';
$this->description = 'Should we put a website in production today? (French)'; $this->description = 'Should we put a website in production today? (French)';
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
public function collectData(array $param) { public function collectData(array $param) {
@ -20,16 +20,8 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
$html = $this->file_get_html($this->getURI()) or $this->returnError('Could not request EstCeQuonMetEnProd: '.$this->getURI(), 500); $html = $this->file_get_html($this->getURI()) or $this->returnError('Could not request EstCeQuonMetEnProd: '.$this->getURI(), 500);
$img = $html->find('img', 0);
if (is_object($img)) {
$img = $img->src;
if ($img[0] == '/')
$img = substr($this->getURI(), 0, strlen($this->getURI()) - 1).$img;
}
$item = new \Item(); $item = new \Item();
$item->uri = $this->getURI().'#'.date('Y-m-d'); $item->uri = $this->getURI().'#'.date('Y-m-d');
$item->thumbnailUri = $img;
$item->title = $this->getName(); $item->title = $this->getName();
$item->author = 'Nicolas Hoffmann'; $item->author = 'Nicolas Hoffmann';
$item->timestamp = strtotime('today midnight'); $item->timestamp = strtotime('today midnight');

View file

@ -7,7 +7,7 @@ class FacebookBridge extends BridgeAbstract{
$this->name = "Facebook"; $this->name = "Facebook";
$this->uri = "http://www.facebook.com/"; $this->uri = "http://www.facebook.com/";
$this->description = "Input a page title or a profile log. For a profile log, please insert the parameter as follow : myExamplePage/132621766841117"; $this->description = "Input a page title or a profile log. For a profile log, please insert the parameter as follow : myExamplePage/132621766841117";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -197,15 +197,8 @@ class FacebookBridge extends BridgeAbstract{
if (strlen($title) > 64) if (strlen($title) > 64)
$title = substr($title, 0, strpos(wordwrap($title, 64), "\n")).'...'; $title = substr($title, 0, strpos(wordwrap($title, 64), "\n")).'...';
//Use first image as thumbnail if available, or profile pic fallback
$thumbnail = $post->find('img', 1);
if (is_object($thumbnail))
$thumbnail = $thumbnail->src;
else $thumbnail = $profilePic;
//Build and add final item //Build and add final item
$item->uri = 'https://facebook.com'.$post->find('abbr')[0]->parent()->getAttribute('href'); $item->uri = 'https://facebook.com'.$post->find('abbr')[0]->parent()->getAttribute('href');
$item->thumbnailUri = $thumbnail;
$item->content = $content; $item->content = $content;
$item->title = $title; $item->title = $title;
$item->author = $author; $item->author = $author;

View file

@ -7,7 +7,7 @@ class FlickrExploreBridge extends BridgeAbstract{
$this->name = "Flickr Explore"; $this->name = "Flickr Explore";
$this->uri = "https://www.flickr.com/explore"; $this->uri = "https://www.flickr.com/explore";
$this->description = "Returns the latest interesting images from Flickr"; $this->description = "Returns the latest interesting images from Flickr";
$this->update = "2016-07-30"; $this->update = "2016-08-09";
} }
@ -30,8 +30,7 @@ class FlickrExploreBridge extends BridgeAbstract{
$item = new \Item(); $item = new \Item();
$item->uri = 'https://flickr.com/photo.gne?id='.$imageID; $item->uri = 'https://flickr.com/photo.gne?id='.$imageID;
$item->thumbnailUri = $imageURI; $item->content = '<a href="' . $item->uri . '"><img src="' . $imageURI . '" /></a>'; // FIXME: Filter javascript ?
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a>'; // FIXME: Filter javascript ?
$item->title = $imageJSON->photo->title->_content; $item->title = $imageJSON->photo->title->_content;
$this->items[] = $item; $this->items[] = $item;
} }

View file

@ -7,7 +7,7 @@ class FlickrTagBridge extends BridgeAbstract{
$this->name = "Flickr TagUser"; $this->name = "Flickr TagUser";
$this->uri = "http://www.flickr.com/"; $this->uri = "http://www.flickr.com/";
$this->description = "Returns the tagged or user images from Flickr"; $this->description = "Returns the tagged or user images from Flickr";
$this->update = "2014-05-26"; $this->update = "2016-08-09";
$this->parameters["By keyword"] = $this->parameters["By keyword"] =
'[ '[
@ -44,8 +44,8 @@ class FlickrTagBridge extends BridgeAbstract{
foreach($html->find('span.photo_container') as $element) { foreach($html->find('span.photo_container') as $element) {
$item = new \Item(); $item = new \Item();
$item->uri = 'http://flickr.com'.$element->find('a',0)->href; $item->uri = 'http://flickr.com'.$element->find('a',0)->href;
$item->thumbnailUri = $element->find('img',0)->getAttribute('data-defer-src'); $thumbnailUri = $element->find('img',0)->getAttribute('data-defer-src');
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a>'; // FIXME: Filter javascript ? $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a>'; // FIXME: Filter javascript ?
$item->title = $element->find('a',0)->title; $item->title = $element->find('a',0)->title;
$this->items[] = $item; $this->items[] = $item;
} }

View file

@ -7,7 +7,7 @@ class FootitoBridge extends BridgeAbstract{
$this->name = "Footito"; $this->name = "Footito";
$this->uri = "http://www.footito.fr/"; $this->uri = "http://www.footito.fr/";
$this->description = "Footito"; $this->description = "Footito";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -36,7 +36,7 @@ class FootitoBridge extends BridgeAbstract{
$info = $element->find('div.infos', 0); $info = $element->find('div.infos', 0);
$item->timestamp = strtotime($info->find('time', 0)->datetime); $item->timestamp = strtotime($info->find('time', 0)->datetime);
$item->name = $info->find('a.auteur', 0)->plaintext; $item->author = $info->find('a.auteur', 0)->plaintext;
$this->items[] = $item; $this->items[] = $item;
} }

View file

@ -8,7 +8,7 @@ class Freenews extends RssExpander {
$this->name = "Freenews"; $this->name = "Freenews";
$this->uri = "http://freenews.fr"; $this->uri = "http://freenews.fr";
$this->description = "Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales."; $this->description = "Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales.";
$this->update = "26/03/2014"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -38,7 +38,7 @@ class Freenews extends RssExpander {
$content = $articlePage->find('.post-container', 0); $content = $articlePage->find('.post-container', 0);
$item->content = $content->innertext; $item->content = $content->innertext;
$item->name = $articlePage->find('a[rel=author]', 0)->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 // 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); $item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
return $item; return $item;

View file

@ -7,7 +7,7 @@ class FuturaSciencesBridge extends BridgeAbstract {
$this->name = 'Futura-Sciences Bridge'; $this->name = 'Futura-Sciences Bridge';
$this->uri = 'http://www.futura-sciences.com/'; $this->uri = 'http://www.futura-sciences.com/';
$this->description = 'Returns the newest articles.'; $this->description = 'Returns the newest articles.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -209,7 +209,6 @@ class FuturaSciencesBridge extends BridgeAbstract {
$item->author = ExtractAuthor($article, $element); $item->author = ExtractAuthor($article, $element);
$item->uri = $article_url; $item->uri = $article_url;
$item->title = StripCDATA($element->find('title', 0)->innertext); $item->title = StripCDATA($element->find('title', 0)->innertext);
$item->thumbnailUri = StripCDATA($element->find('enclosure', 0)->url);
$item->timestamp = strtotime(StripCDATA($element->find('pubDate', 0)->plaintext)); $item->timestamp = strtotime(StripCDATA($element->find('pubDate', 0)->plaintext));
$item->content = trim($contents); $item->content = trim($contents);
$this->items[] = $item; $this->items[] = $item;

View file

@ -9,7 +9,7 @@ class GBAtempBridge extends BridgeAbstract {
$this->name = 'GBAtemp'; $this->name = 'GBAtemp';
$this->uri = $this->getURI(); $this->uri = $this->getURI();
$this->description = 'GBAtemp is a user friendly underground video game community.'; $this->description = 'GBAtemp is a user friendly underground video game community.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -56,13 +56,12 @@ class GBAtempBridge extends BridgeAbstract {
} return $string; } return $string;
} }
private function build_item($uri, $title, $author, $timestamp, $thumnail, $content) { private function build_item($uri, $title, $author, $timestamp, $content) {
$item = new \Item(); $item = new \Item();
$item->uri = $uri; $item->uri = $uri;
$item->title = $title; $item->title = $title;
$item->author = $author; $item->author = $author;
$item->timestamp = $timestamp; $item->timestamp = $timestamp;
$item->thumbnailUri = $thumnail;
$item->content = $content; $item->content = $content;
return $item; return $item;
} }
@ -97,17 +96,15 @@ class GBAtempBridge extends BridgeAbstract {
if ($typeFilter == 'N') { if ($typeFilter == 'N') {
foreach ($html->find('li[class=news_item full]') as $newsItem) { foreach ($html->find('li[class=news_item full]') as $newsItem) {
$url = $this->getURI().$newsItem->find('a', 0)->href; $url = $this->getURI().$newsItem->find('a', 0)->href;
$img = $this->getURI().$newsItem->find('img', 0)->src;
$time = intval($this->ExtractFromDelimiters($newsItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"')); $time = intval($this->ExtractFromDelimiters($newsItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
$author = $newsItem->find('a.username', 0)->plaintext; $author = $newsItem->find('a.username', 0)->plaintext;
$title = $newsItem->find('a', 1)->plaintext; $title = $newsItem->find('a', 1)->plaintext;
$content = $this->fetch_post_content($url, $this->getURI()); $content = $this->fetch_post_content($url, $this->getURI());
$this->items[] = $this->build_item($url, $title, $author, $time, $img, $content); $this->items[] = $this->build_item($url, $title, $author, $time, $content);
} }
} else if ($typeFilter == 'R') { } else if ($typeFilter == 'R') {
foreach ($html->find('li.portal_review') as $reviewItem) { foreach ($html->find('li.portal_review') as $reviewItem) {
$url = $this->getURI().$reviewItem->find('a', 0)->href; $url = $this->getURI().$reviewItem->find('a', 0)->href;
$img = $this->getURI().$this->ExtractFromDelimiters($reviewItem->find('a', 0)->style, 'image:url(', ')');
$title = $reviewItem->find('span.review_title', 0)->plaintext; $title = $reviewItem->find('span.review_title', 0)->plaintext;
$content = $this->file_get_html($url) or $this->returnError('Could not request GBAtemp: '.$uri, 500); $content = $this->file_get_html($url) or $this->returnError('Could not request GBAtemp: '.$uri, 500);
$author = $content->find('a.username', 0)->plaintext; $author = $content->find('a.username', 0)->plaintext;
@ -118,7 +115,7 @@ class GBAtempBridge extends BridgeAbstract {
$procons = $content->find('table.review_procons', 0)->outertext; $procons = $content->find('table.review_procons', 0)->outertext;
$scores = $content->find('table.reviewscores', 0)->outertext; $scores = $content->find('table.reviewscores', 0)->outertext;
$content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, $this->getURI()); $content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, $this->getURI());
$this->items[] = $this->build_item($url, $title, $author, $time, $img, $content); $this->items[] = $this->build_item($url, $title, $author, $time, $content);
} }
} else if ($typeFilter == 'T') { } else if ($typeFilter == 'T') {
foreach ($html->find('li.portal-tutorial') as $tutorialItem) { foreach ($html->find('li.portal-tutorial') as $tutorialItem) {
@ -127,7 +124,7 @@ class GBAtempBridge extends BridgeAbstract {
$time = intval($this->ExtractFromDelimiters($tutorialItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"')); $time = intval($this->ExtractFromDelimiters($tutorialItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
$author = $tutorialItem->find('a.username', 0)->plaintext; $author = $tutorialItem->find('a.username', 0)->plaintext;
$content = $this->fetch_post_content($url, $this->getURI()); $content = $this->fetch_post_content($url, $this->getURI());
$this->items[] = $this->build_item($url, $title, $author, $time, '', $content); $this->items[] = $this->build_item($url, $title, $author, $time, $content);
} }
} else if ($typeFilter == 'F') { } else if ($typeFilter == 'F') {
foreach ($html->find('li.rc_item') as $postItem) { foreach ($html->find('li.rc_item') as $postItem) {
@ -136,7 +133,7 @@ class GBAtempBridge extends BridgeAbstract {
$time = intval($this->ExtractFromDelimiters($postItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"')); $time = intval($this->ExtractFromDelimiters($postItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
$author = $postItem->find('a.username', 0)->plaintext; $author = $postItem->find('a.username', 0)->plaintext;
$content = $this->fetch_post_content($url, $this->getURI()); $content = $this->fetch_post_content($url, $this->getURI());
$this->items[] = $this->build_item($url, $title, $author, $time, '', $content); $this->items[] = $this->build_item($url, $title, $author, $time, $content);
} }
} }
} }

View file

@ -10,7 +10,7 @@ class Gawker extends RssExpander{
$this->name = "Gawker media"; $this->name = "Gawker media";
$this->uri = "http://feeds.gawker.com/"; $this->uri = "http://feeds.gawker.com/";
$this->description = "A bridge allowing access to any of the numerous Gawker media blogs (Lifehacker, deadspin, Kotaku, Jezebel, and so on. Notice you have to give its id to find the RSS stream in gawker maze"; $this->description = "A bridge allowing access to any of the numerous Gawker media blogs (Lifehacker, deadspin, Kotaku, Jezebel, and so on. Notice you have to give its id to find the RSS stream in gawker maze";
$this->update = "27/03/2014"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -53,7 +53,7 @@ class Gawker extends RssExpander{
$vcard = $articlePage->find('.vcard', 0); $vcard = $articlePage->find('.vcard', 0);
if(is_object($vcard)) { if(is_object($vcard)) {
$authorLink = $vcard->find('a', 0); $authorLink = $vcard->find('a', 0);
$item->name = $authorLink->innertext; $item->author = $authorLink->innertext;
// TODO use author link href to fill the feed info // TODO use author link href to fill the feed info
} }
// $this->message("item quite loaded : ".var_export($item, true)); // $this->message("item quite loaded : ".var_export($item, true));

View file

@ -7,7 +7,7 @@ class GelbooruBridge extends BridgeAbstract{
$this->name = "Gelbooru"; $this->name = "Gelbooru";
$this->uri = "http://gelbooru.com/"; $this->uri = "http://gelbooru.com/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -42,10 +42,10 @@ class GelbooruBridge extends BridgeAbstract{
$item->uri = 'http://gelbooru.com/'.$element->find('a', 0)->href; $item->uri = 'http://gelbooru.com/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src; $thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('alt'); $item->tags = $element->find('img', 0)->getAttribute('alt');
$item->title = 'Gelbooru | '.$item->postid; $item->title = 'Gelbooru | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -12,7 +12,7 @@ class GithubIssueBridge extends BridgeAbstract{
$this->name = 'Github Issue'; $this->name = 'Github Issue';
$this->uri = ''; $this->uri = '';
$this->description = 'Returns the comments of a github project issue'; $this->description = 'Returns the comments of a github project issue';
$this->update = '2016-06-25'; $this->update = '2016-08-09';
$this->parameters[]= $this->parameters[]=
'[ '[
@ -40,7 +40,7 @@ class GithubIssueBridge extends BridgeAbstract{
foreach($html->find('.js-comment-container') as $comment){ foreach($html->find('.js-comment-container') as $comment){
$item = new \Item(); $item = new \Item();
$item->name=$comment->find('img',0)->getAttribute('alt'); $item->author=$comment->find('img',0)->getAttribute('alt');
$comment=$comment->firstChild()->nextSibling(); $comment=$comment->firstChild()->nextSibling();

View file

@ -12,7 +12,7 @@ class GitlabCommitsBridge extends BridgeAbstract{
$this->name = 'Gitlab Commits'; $this->name = 'Gitlab Commits';
$this->uri = ''; $this->uri = '';
$this->description = 'Returns the commits of a project hosted on a gitlab instance'; $this->description = 'Returns the commits of a project hosted on a gitlab instance';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -64,7 +64,7 @@ class GitlabCommitsBridge extends BridgeAbstract{
$item->title=$a->plaintext; $item->title=$a->plaintext;
} }
if(in_array('commit-author-link',$classes)){ if(in_array('commit-author-link',$classes)){
$item->name=trim($a->plaintext); $item->author=trim($a->plaintext);
} }
} }

View file

@ -10,7 +10,7 @@ class HDWallpapersBridge extends BridgeAbstract {
$this->name = "HD Wallpapers Bridge"; $this->name = "HD Wallpapers Bridge";
$this->uri = "http://www.hdwallpapers.in/"; $this->uri = "http://www.hdwallpapers.in/";
$this->description = "Returns the latests wallpapers from HDWallpapers"; $this->description = "Returns the latests wallpapers from HDWallpapers";
$this->update = "2015-04-08"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -63,8 +63,7 @@ class HDWallpapersBridge extends BridgeAbstract {
$item->uri = $baseUri.'/download'.str_replace('wallpapers.html', $this->resolution.'.jpg', $element->href); $item->uri = $baseUri.'/download'.str_replace('wallpapers.html', $this->resolution.'.jpg', $element->href);
$item->timestamp = time(); $item->timestamp = time();
$item->title = $element->find('p', 0)->text(); $item->title = $element->find('p', 0)->text();
$item->thumbnailUri = $baseUri.$thumbnail->src; $item->content = $item->title.'<br><a href="'.$item->uri.'"><img src="'.$baseUri.$thumbnail->src.'" /></a>';
$item->content = $item->title.'<br><a href="'.$item->uri.'"><img src="'.$item->thumbnailUri.'" /></a>';
$this->items[] = $item; $this->items[] = $item;
$num++; $num++;

View file

@ -7,7 +7,7 @@ class HentaiHavenBridge extends BridgeAbstract{
$this->name = "Hentai Haven"; $this->name = "Hentai Haven";
$this->uri = "http://hentaihaven.org/"; $this->uri = "http://hentaihaven.org/";
$this->description = "Returns releases from Hentai Haven"; $this->description = "Returns releases from Hentai Haven";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -16,10 +16,10 @@ class HentaiHavenBridge extends BridgeAbstract{
foreach($html->find('div.zoe-grid') as $element) { foreach($html->find('div.zoe-grid') as $element) {
$item = new \Item(); $item = new \Item();
$item->uri = $this->getURI().$element->find('div.brick-content h3 a', 0)->href; $item->uri = $this->getURI().$element->find('div.brick-content h3 a', 0)->href;
$item->thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src'); $thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src');
$item->title = mb_convert_encoding(trim($element->find('div.brick-content h3 a', 0)->innertext), 'UTF-8', 'HTML-ENTITIES'); $item->title = mb_convert_encoding(trim($element->find('div.brick-content h3 a', 0)->innertext), 'UTF-8', 'HTML-ENTITIES');
$item->tags = $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent span.tags', 0)->plaintext; $item->tags = $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent span.tags', 0)->plaintext;
$item->content = 'Tags: ' . $item->tags.'<br><br><a href="' . $item->uri . '"><img width="300" height="169" src="' . $item->thumbnailUri . '" /></a><br>' . $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent p.description', 0)->innertext; $item->content = 'Tags: ' . $item->tags.'<br><br><a href="' . $item->uri . '"><img width="300" height="169" src="' . $thumbnailUri . '" /></a><br>' . $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent p.description', 0)->innertext;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -6,7 +6,7 @@ class JapanExpoBridge extends BridgeAbstract{
$this->name = 'JapanExpo'; $this->name = 'JapanExpo';
$this->uri = 'http://www.japan-expo-paris.com/fr/actualites'; $this->uri = 'http://www.japan-expo-paris.com/fr/actualites';
$this->description = 'Returns most recent entries from Japan Expo actualités.'; $this->description = 'Returns most recent entries from Japan Expo actualités.';
$this->update = '2016-06-12'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
{ {
@ -96,7 +96,6 @@ class JapanExpoBridge extends BridgeAbstract{
$item->uri = $url; $item->uri = $url;
$item->title = $title; $item->title = $title;
$item->timestamp = $timestamp; $item->timestamp = $timestamp;
$item->thumbnailUri = $thumbnail;
$item->content = $content; $item->content = $content;
$this->items[] = $item; $this->items[] = $item;
$count++; $count++;

View file

@ -7,7 +7,7 @@ class KonachanBridge extends BridgeAbstract{
$this->name = "Konachan"; $this->name = "Konachan";
$this->uri = "http://konachan.com/"; $this->uri = "http://konachan.com/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -44,9 +44,8 @@ class KonachanBridge extends BridgeAbstract{
$item->postid = $json['id']; $item->postid = $json['id'];
$item->timestamp = $json['created_at']; $item->timestamp = $json['created_at'];
$item->imageUri = $json['file_url']; $item->imageUri = $json['file_url'];
$item->thumbnailUri = $json['preview_url'];
$item->title = 'Konachan | '.$json['id']; $item->title = 'Konachan | '.$json['id'];
$item->content = '<a href="' . $item->imageUri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$json['tags']; $item->content = '<a href="' . $item->imageUri . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -12,7 +12,7 @@ class LWNprevBridge extends BridgeAbstract{
$this->name = 'LWN Free Weekly Edition'; $this->name = 'LWN Free Weekly Edition';
$this->uri = 'https://lwn.net/free/bigpage'; $this->uri = 'https://lwn.net/free/bigpage';
$this->description = 'LWN Free Weekly Edition available one week late'; $this->description = 'LWN Free Weekly Edition available one week late';
$this->update = '2016-19-01'; $this->update = '2016-08-09';
} }
@ -88,14 +88,14 @@ class LWNprevBridge extends BridgeAbstract{
switch($h2NextSibling->getAttribute('class')){ switch($h2NextSibling->getAttribute('class')){
case 'FeatureByline': case 'FeatureByline':
$item->name=$h2NextSibling->getElementsByTagName('b')->item(0)->textContent; $item->author=$h2NextSibling->getElementsByTagName('b')->item(0)->textContent;
break; break;
case 'GAByline': case 'GAByline':
$text=$h2NextSibling->textContent; $text=$h2NextSibling->textContent;
$item->name=substr($text,strpos($text,'by ')); $item->author=substr($text,strpos($text,'by '));
break; break;
default: default:
$item->name='LWN'; $item->author='LWN';
break; break;
}; };

View file

@ -7,7 +7,7 @@ class LeMondeInformatiqueBridge extends BridgeAbstract {
$this->name = "Le Monde Informatique"; $this->name = "Le Monde Informatique";
$this->uri = "http://www.lemondeinformatique.fr/"; $this->uri = "http://www.lemondeinformatique.fr/";
$this->description = "Returns the newest articles."; $this->description = "Returns the newest articles.";
$this->update = "2016-01-28"; $this->update = "2016-08-09";
} }
@ -45,14 +45,12 @@ class LeMondeInformatiqueBridge extends BridgeAbstract {
$article_uri = substr($article_uri, strpos($article_uri, '<link>') + 6); $article_uri = substr($article_uri, strpos($article_uri, '<link>') + 6);
$article_uri = substr($article_uri, 0, strpos($article_uri, '</link>')); $article_uri = substr($article_uri, 0, strpos($article_uri, '</link>'));
$article_html = $this->file_get_html($article_uri) or $this->returnError('Could not request LeMondeInformatique: '.$article_uri, 500); $article_html = $this->file_get_html($article_uri) or $this->returnError('Could not request LeMondeInformatique: '.$article_uri, 500);
$thumbnailUri = $article_html->find('div#article', 0)->find('img#illustration', 0)->src;
$article_content = CleanArticle($article_html->find('div#article', 0)->innertext); $article_content = CleanArticle($article_html->find('div#article', 0)->innertext);
$article_title = $article_html->find('h1.cleanprint-title', 0)->plaintext; $article_title = $article_html->find('h1.cleanprint-title', 0)->plaintext;
//Build and add final item //Build and add final item
$item = new \Item(); $item = new \Item();
$item->uri = $article_uri; $item->uri = $article_uri;
$item->thumbnailUri = $thumbnailUri;
$item->title = $article_title; $item->title = $article_title;
$item->author = StripCDATA($element->find('dc:creator', 0)->innertext); $item->author = StripCDATA($element->find('dc:creator', 0)->innertext);
$item->timestamp = strtotime($element->find('dc:date', 0)->plaintext); $item->timestamp = strtotime($element->find('dc:date', 0)->plaintext);

View file

@ -10,7 +10,7 @@ class Les400Culs extends RssExpander{
$this->name = "Les 400 Culs"; $this->name = "Les 400 Culs";
$this->uri = "http://sexes.blogs.liberation.fr"; $this->uri = "http://sexes.blogs.liberation.fr";
$this->description = "La planete sexe vue par Agnes Girard via rss-bridge"; $this->description = "La planete sexe vue par Agnes Girard via rss-bridge";
$this->update = "20/02/2014"; $this->update = "2016-08-09";
} }
@ -34,7 +34,7 @@ class Les400Culs extends RssExpander{
// $content = $articlePage->find('.post-container', 0); // $content = $articlePage->find('.post-container', 0);
$item->content = (string) $newsItem->description; $item->content = (string) $newsItem->description;
$item->name = (string) $newsItem->author; $item->author = (string) $newsItem->author;
$item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem); $item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
return $item; return $item;
} }

View file

@ -7,7 +7,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
$this->name = "Les Joies Du Code"; $this->name = "Les Joies Du Code";
$this->uri = "http://lesjoiesducode.fr/"; $this->uri = "http://lesjoiesducode.fr/";
$this->description = "LesJoiesDuCode"; $this->description = "LesJoiesDuCode";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -36,7 +36,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
if($pos > 0) if($pos > 0)
{ {
$auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2)))); $auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2))));
$item->name = $auteur; $item->author = $auteur;
} }

View file

@ -7,7 +7,7 @@ class LinkedInCompany extends BridgeAbstract{
$this->name = "LinkedIn Company"; $this->name = "LinkedIn Company";
$this->uri = "https://www.linkedin.com/"; $this->uri = "https://www.linkedin.com/";
$this->description = "Returns most recent actus from Company on LinkedIn. (https://www.linkedin.com/company/<strong style=\"font-weight:bold;\">apple</strong>)"; $this->description = "Returns most recent actus from Company on LinkedIn. (https://www.linkedin.com/company/<strong style=\"font-weight:bold;\">apple</strong>)";
$this->update = "2015-12-22"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -31,7 +31,6 @@ class LinkedInCompany extends BridgeAbstract{
$item->uri = $link; $item->uri = $link;
$item->title = mb_substr(strip_tags($element->find('span.share-body', 0)->innertext), 0 ,100); $item->title = mb_substr(strip_tags($element->find('span.share-body', 0)->innertext), 0 ,100);
$item->content = strip_tags($element->find('span.share-body', 0)->innertext); $item->content = strip_tags($element->find('span.share-body', 0)->innertext);
$item->thumbnailUri = htmlspecialchars_decode($element->find('img', 0)->attr['data-li-lazy-load-src']);
$this->items[] = $item; $this->items[] = $item;
$i++; $i++;
} }

View file

@ -7,7 +7,7 @@ class LolibooruBridge extends BridgeAbstract{
$this->name = "Lolibooru"; $this->name = "Lolibooru";
$this->uri = "http://lolibooru.moe/"; $this->uri = "http://lolibooru.moe/";
$this->description = "Returns images from given page and tags"; $this->description = "Returns images from given page and tags";
$this->update = "2015-03-21"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -45,9 +45,8 @@ class LolibooruBridge extends BridgeAbstract{
$item->postid = $json['id']; $item->postid = $json['id'];
$item->timestamp = $json['created_at']; $item->timestamp = $json['created_at'];
$item->imageUri = $json['file_url']; $item->imageUri = $json['file_url'];
$item->thumbnailUri = $json['preview_url'];
$item->title = 'Lolibooru | '.$json['id']; $item->title = 'Lolibooru | '.$json['id'];
$item->content = '<a href="' . $item->imageUri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$json['tags']; $item->content = '<a href="' . $item->imageUri . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -8,7 +8,7 @@ class MangareaderBridge extends BridgeAbstract{
$this->name = "Mangareader Bridge"; $this->name = "Mangareader Bridge";
$this->uri = "http://www.mangareader.net"; $this->uri = "http://www.mangareader.net";
$this->description = "Returns the latest updates, popular mangas or manga updates (new chapters)"; $this->description = "Returns the latest updates, popular mangas or manga updates (new chapters)";
$this->update = "2016-01-22"; $this->update = "2016-08-09";
$this->parameters["Get latest updates"] = '[]'; $this->parameters["Get latest updates"] = '[]';
$this->parameters["Get popular mangas"] = $this->parameters["Get popular mangas"] =
@ -281,15 +281,15 @@ class MangareaderBridge extends BridgeAbstract{
// The thumbnail is encrypted in a css-style... // The thumbnail is encrypted in a css-style...
// format: "background-image:url('<the part which is actually interesting>')" // format: "background-image:url('<the part which is actually interesting>')"
$mangaimgelement = $xpath->query(".//*[@class='imgsearchresults']", $manga)->item(0)->getAttribute('style'); $mangaimgelement = $xpath->query(".//*[@class='imgsearchresults']", $manga)->item(0)->getAttribute('style');
$thumbnail = substr($mangaimgelement, 22, strlen($mangaimgelement) - 24);
$item = new \Item(); $item = new \Item();
$item->title = htmlspecialchars($xpath->query(".//*[@class='manga_name']//a", $manga)->item(0)->nodeValue); $item->title = htmlspecialchars($xpath->query(".//*[@class='manga_name']//a", $manga)->item(0)->nodeValue);
$item->uri = 'http://www.mangareader.net' . $xpath->query(".//*[@class='manga_name']//a", $manga)->item(0)->getAttribute('href'); $item->uri = 'http://www.mangareader.net' . $xpath->query(".//*[@class='manga_name']//a", $manga)->item(0)->getAttribute('href');
$item->author = htmlspecialchars($xpath->query("//*[@class='author_name']", $manga)->item(0)->nodeValue); $item->author = htmlspecialchars($xpath->query("//*[@class='author_name']", $manga)->item(0)->nodeValue);
$item->chaptercount = $xpath->query(".//*[@class='chapter_count']", $manga)->item(0)->nodeValue; $item->chaptercount = $xpath->query(".//*[@class='chapter_count']", $manga)->item(0)->nodeValue;
$item->genre = htmlspecialchars($xpath->query(".//*[@class='manga_genre']", $manga)->item(0)->nodeValue); $item->genre = htmlspecialchars($xpath->query(".//*[@class='manga_genre']", $manga)->item(0)->nodeValue);
$item->thumbnailUri = substr($mangaimgelement, 22, strlen($mangaimgelement) - 24); $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnail . '" alt="' . $item->title . '" /></a><p>' . $item->genre . '</p><p>' . $item->chaptercount . '</p>';
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" alt="' . $item->title . '" /></a><p>' . $item->genre . '</p><p>' . $item->chaptercount . '</p>';
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class MilbooruBridge extends BridgeAbstract{
$this->name = "Milbooru"; $this->name = "Milbooru";
$this->uri = "http://sheslostcontrol.net/moe/shimmie/"; $this->uri = "http://sheslostcontrol.net/moe/shimmie/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -39,10 +39,10 @@ class MilbooruBridge extends BridgeAbstract{
$item->uri = 'http://sheslostcontrol.net/moe/shimmie/'.$element->find('a', 0)->href; $item->uri = 'http://sheslostcontrol.net/moe/shimmie/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->find('a', 0)->getAttribute('data-post-id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->find('a', 0)->getAttribute('data-post-id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = 'http://sheslostcontrol.net/moe/shimmie/'.$element->find('img', 0)->src; $thumbnailUri = 'http://sheslostcontrol.net/moe/shimmie/'.$element->find('img', 0)->src;
$item->tags = $element->find('a', 0)->getAttribute('data-tags'); $item->tags = $element->find('a', 0)->getAttribute('data-tags');
$item->title = 'Milbooru | '.$item->postid; $item->title = 'Milbooru | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class MspabooruBridge extends BridgeAbstract{
$this->name = "Mspabooru"; $this->name = "Mspabooru";
$this->uri = "http://mspabooru.com/"; $this->uri = "http://mspabooru.com/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -42,10 +42,10 @@ class MspabooruBridge extends BridgeAbstract{
$item->uri = 'http://mspabooru.com/'.$element->find('a', 0)->href; $item->uri = 'http://mspabooru.com/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src; $thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('alt'); $item->tags = $element->find('img', 0)->getAttribute('alt');
$item->title = 'Mspabooru | '.$item->postid; $item->title = 'Mspabooru | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -6,7 +6,7 @@ class NakedSecurityBridge extends BridgeAbstract {
$this->name = 'Naked Security'; $this->name = 'Naked Security';
$this->uri = 'https://nakedsecurity.sophos.com/'; $this->uri = 'https://nakedsecurity.sophos.com/';
$this->description = 'Returns the newest articles.'; $this->description = 'Returns the newest articles.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
} }
public function collectData(array $param) { public function collectData(array $param) {
@ -60,7 +60,6 @@ class NakedSecurityBridge extends BridgeAbstract {
$item = new \Item(); $item = new \Item();
$item->uri = $article_uri; $item->uri = $article_uri;
$item->title = $article_title; $item->title = $article_title;
$item->thumbnailUri = $article_image;
$item->author = $article_html->find('a[rel=author]', 0)->plaintext; $item->author = $article_html->find('a[rel=author]', 0)->plaintext;
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
$item->content = $article_content; $item->content = $article_content;

View file

@ -6,7 +6,7 @@ class NeuviemeArtBridge extends BridgeAbstract {
$this->name = "9ème Art"; $this->name = "9ème Art";
$this->uri = "http://www.9emeart.fr/"; $this->uri = "http://www.9emeart.fr/";
$this->description = "Returns the newest articles."; $this->description = "Returns the newest articles.";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
public function collectData(array $param) { public function collectData(array $param) {
@ -46,7 +46,6 @@ class NeuviemeArtBridge extends BridgeAbstract {
$item = new \Item(); $item = new \Item();
$item->uri = $article_uri; $item->uri = $article_uri;
$item->title = $article_title; $item->title = $article_title;
$item->thumbnailUri = $element->find('enclosure', 0)->url;
$item->author = $article_html->find('a[class=upp transition_fast upp]', 0)->plaintext; $item->author = $article_html->find('a[class=upp transition_fast upp]', 0)->plaintext;
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
$item->content = $article_content; $item->content = $article_content;

View file

@ -6,7 +6,7 @@ class NextInpactBridge extends BridgeAbstract {
$this->name = "NextInpact Bridge"; $this->name = "NextInpact Bridge";
$this->uri = "http://www.nextinpact.com/"; $this->uri = "http://www.nextinpact.com/";
$this->description = "Returns the newest articles."; $this->description = "Returns the newest articles.";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
private function StripCDATA($string) { private function StripCDATA($string) {
@ -35,7 +35,6 @@ class NextInpactBridge extends BridgeAbstract {
$item = new \Item(); $item = new \Item();
$item->title = $this->StripCDATA($element->find('title', 0)->innertext); $item->title = $this->StripCDATA($element->find('title', 0)->innertext);
$item->uri = $this->StripCDATA($element->find('guid', 0)->plaintext); $item->uri = $this->StripCDATA($element->find('guid', 0)->plaintext);
$item->thumbnailUri = $this->StripCDATA($element->find('enclosure', 0)->url);
$item->author = $this->StripCDATA($element->find('creator', 0)->innertext); $item->author = $this->StripCDATA($element->find('creator', 0)->innertext);
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
$item->content = $this->ExtractContent($item->uri); $item->content = $this->ExtractContent($item->uri);

View file

@ -7,7 +7,7 @@ class NextgovBridge extends BridgeAbstract {
$this->name = 'Nextgov Bridge'; $this->name = 'Nextgov Bridge';
$this->uri = 'https://www.nextgov.com/'; $this->uri = 'https://www.nextgov.com/';
$this->description = 'USA Federal technology news, best practices, and web 2.0 tools.'; $this->description = 'USA Federal technology news, best practices, and web 2.0 tools.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -79,14 +79,10 @@ class NextgovBridge extends BridgeAbstract {
.'<p><b>'.$article_subtitle.'</b></p>' .'<p><b>'.$article_subtitle.'</b></p>'
.trim($contents); .trim($contents);
if ($article_thumbnail == '')
$article_thumbnail = 'http://cdn.nextgov.com/nextgov/images/logo.png';
$item = new \Item(); $item = new \Item();
$item->uri = $article_url; $item->uri = $article_url;
$item->title = $article_title; $item->title = $article_title;
$item->author = $article_author; $item->author = $article_author;
$item->thumbnailUri = $article_thumbnail;
$item->timestamp = $article_timestamp; $item->timestamp = $article_timestamp;
$item->content = $contents; $item->content = $contents;
$this->items[] = $item; $this->items[] = $item;

View file

@ -11,7 +11,7 @@ class PickyWallpapersBridge extends BridgeAbstract {
$this->name = "PickyWallpapers Bridge"; $this->name = "PickyWallpapers Bridge";
$this->uri = "http://www.pickywallpapers.com/"; $this->uri = "http://www.pickywallpapers.com/";
$this->description = "Returns the latests wallpapers from PickyWallpapers"; $this->description = "Returns the latests wallpapers from PickyWallpapers";
$this->update = "2014-03-31"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -68,7 +68,6 @@ class PickyWallpapersBridge extends BridgeAbstract {
$item->uri = str_replace('www', 'wallpaper', $baseUri).'/'.$this->resolution.'/'.basename($element->src); $item->uri = str_replace('www', 'wallpaper', $baseUri).'/'.$this->resolution.'/'.basename($element->src);
$item->timestamp = time(); $item->timestamp = time();
$item->title = $element->alt; $item->title = $element->alt;
$item->thumbnailUri = $element->src;
$item->content = $item->title.'<br><a href="'.$item->uri.'">'.$element.'</a>'; $item->content = $item->title.'<br><a href="'.$item->uri.'">'.$element.'</a>';
$this->items[] = $item; $this->items[] = $item;

View file

@ -5,6 +5,7 @@ class RTBFBridge extends BridgeAbstract {
$this->uri = "http://www.rtbf.be/auvio/emissions"; $this->uri = "http://www.rtbf.be/auvio/emissions";
$this->description = "Returns the newest RTBF videos by series ID"; $this->description = "Returns the newest RTBF videos by series ID";
$this->maintainer = "Frenzie"; $this->maintainer = "Frenzie";
$this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -33,10 +34,10 @@ class RTBFBridge extends BridgeAbstract {
$item->uri = 'http://www.rtbf.be/auvio/detail?id='.$item->id; $item->uri = 'http://www.rtbf.be/auvio/detail?id='.$item->id;
$thumbnailUriSrcSet = explode(',', $element->find('figure .www-img-16by9 img', 0)->getAttribute('data-srcset')); $thumbnailUriSrcSet = explode(',', $element->find('figure .www-img-16by9 img', 0)->getAttribute('data-srcset'));
$thumbnailUriLastSrc = end($thumbnailUriSrcSet); $thumbnailUriLastSrc = end($thumbnailUriSrcSet);
$item->thumbnailUri = explode(' ', $thumbnailUriLastSrc)[0]; $thumbnailUri = explode(' ', $thumbnailUriLastSrc)[0];
$item->title = trim($element->find('h3',0)->plaintext) . ' - ' . trim($element->find('h4',0)->plaintext); $item->title = trim($element->find('h3',0)->plaintext) . ' - ' . trim($element->find('h4',0)->plaintext);
$item->timestamp = strtotime($element->find('time', 0)->getAttribute('datetime')); $item->timestamp = strtotime($element->find('time', 0)->getAttribute('datetime'));
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a>'; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a>';
$this->items[] = $item; $this->items[] = $item;
$count++; $count++;
} }

View file

@ -7,7 +7,7 @@ class Releases3DSBridge extends BridgeAbstract {
$this->name = "3DS Scene Releases"; $this->name = "3DS Scene Releases";
$this->uri = "http://www.3dsdb.com/"; $this->uri = "http://www.3dsdb.com/";
$this->description = "Returns the newest scene releases."; $this->description = "Returns the newest scene releases.";
$this->update = "2015-09-17"; $this->update = "2016-08-09";
} }
@ -108,7 +108,6 @@ class Releases3DSBridge extends BridgeAbstract {
$item->title = $name; $item->title = $name;
$item->author = $publisher; $item->author = $publisher;
$item->timestamp = $ignDate; $item->timestamp = $ignDate;
$item->thumbnailUri = $ignCoverArt;
$item->uri = empty($ignLink) ? $searchLinkDuckDuckGo : $ignLink; $item->uri = empty($ignLink) ? $searchLinkDuckDuckGo : $ignLink;
$item->content = $ignDescription.$releaseDescription.$releaseSearchLinks; $item->content = $ignDescription.$releaseDescription.$releaseSearchLinks;
$this->items[] = $item; $this->items[] = $item;

View file

@ -7,7 +7,7 @@ class Rule34Bridge extends BridgeAbstract{
$this->name = "Rule34"; $this->name = "Rule34";
$this->uri = "http://rule34.xxx/"; $this->uri = "http://rule34.xxx/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -41,10 +41,10 @@ class Rule34Bridge extends BridgeAbstract{
$item->uri = 'http://rule34.xxx/'.$element->find('a', 0)->href; $item->uri = 'http://rule34.xxx/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src; $thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('alt'); $item->tags = $element->find('img', 0)->getAttribute('alt');
$item->title = 'Rule34 | '.$item->postid; $item->title = 'Rule34 | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class Rule34pahealBridge extends BridgeAbstract{
$this->name = "Rule34paheal"; $this->name = "Rule34paheal";
$this->uri = "http://rule34.paheal.net/"; $this->uri = "http://rule34.paheal.net/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -40,10 +40,10 @@ class Rule34pahealBridge extends BridgeAbstract{
$item->uri = 'http://rule34.paheal.net'.$element->find('a', 0)->href; $item->uri = 'http://rule34.paheal.net'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->find('img', 0)->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->find('img', 0)->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src; $thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->getAttribute('data-tags'); $item->tags = $element->getAttribute('data-tags');
$item->title = 'Rule34paheal | '.$item->postid; $item->title = 'Rule34paheal | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class SafebooruBridge extends BridgeAbstract{
$this->name = "Safebooru"; $this->name = "Safebooru";
$this->uri = "http://safebooru.org/"; $this->uri = "http://safebooru.org/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -42,10 +42,10 @@ class SafebooruBridge extends BridgeAbstract{
$item->uri = 'http://safebooru.org/'.$element->find('a', 0)->href; $item->uri = 'http://safebooru.org/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src; $thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('alt'); $item->tags = $element->find('img', 0)->getAttribute('alt');
$item->title = 'Safebooru | '.$item->postid; $item->title = 'Safebooru | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class SakugabooruBridge extends BridgeAbstract{
$this->name = "Sakugabooru"; $this->name = "Sakugabooru";
$this->uri = "http://sakuga.yshi.org/"; $this->uri = "http://sakuga.yshi.org/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -44,9 +44,8 @@ class SakugabooruBridge extends BridgeAbstract{
$item->postid = $json['id']; $item->postid = $json['id'];
$item->timestamp = $json['created_at']; $item->timestamp = $json['created_at'];
$item->imageUri = $json['file_url']; $item->imageUri = $json['file_url'];
$item->thumbnailUri = $json['preview_url'];
$item->title = 'Sakugabooru | '.$json['id']; $item->title = 'Sakugabooru | '.$json['id'];
$item->content = '<a href="' . $item->imageUri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$json['tags']; $item->content = '<a href="' . $item->imageUri . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -8,7 +8,7 @@ class SensCritiqueBridge extends BridgeAbstract {
$this->name = "Sens Critique"; $this->name = "Sens Critique";
$this->uri = "http://www.senscritique.com"; $this->uri = "http://www.senscritique.com";
$this->description = "Sens Critique news"; $this->description = "Sens Critique news";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -118,7 +118,7 @@ class SensCritiqueBridge extends BridgeAbstract {
foreach ($list->find('li') as $movie) { foreach ($list->find('li') as $movie) {
$item = new \Item(); $item = new \Item();
$item->name = htmlspecialchars_decode($movie->find('.elco-title a', 0)->plaintext, ENT_QUOTES) . ' ' . $movie->find('.elco-date', 0)->plaintext; $item->author = htmlspecialchars_decode($movie->find('.elco-title a', 0)->plaintext, ENT_QUOTES) . ' ' . $movie->find('.elco-date', 0)->plaintext;
$item->title = $movie->find('.elco-title a', 0)->plaintext . ' ' . $movie->find('.elco-date', 0)->plaintext; $item->title = $movie->find('.elco-title a', 0)->plaintext . ' ' . $movie->find('.elco-date', 0)->plaintext;
$item->content = '<em>' . $movie->find('.elco-original-title', 0)->plaintext . '</em><br><br>' . $item->content = '<em>' . $movie->find('.elco-original-title', 0)->plaintext . '</em><br><br>' .
$movie->find('.elco-baseline', 0)->plaintext . '<br>' . $movie->find('.elco-baseline', 0)->plaintext . '<br>' .

View file

@ -8,7 +8,7 @@ class Sexactu extends BridgeAbstract{
$this->name = "Sexactu"; $this->name = "Sexactu";
$this->uri = "http://www.gqmagazine.fr"; $this->uri = "http://www.gqmagazine.fr";
$this->description = "Sexactu via rss-bridge"; $this->description = "Sexactu via rss-bridge";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -42,7 +42,7 @@ $replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July',
$date = strtotime($dateText); $date = strtotime($dateText);
$item->timestamp = $date; $item->timestamp = $date;
$item->name = "Maïa Mazaurette"; $item->author = "Maïa Mazaurette";
$elementText = $element->find('.text-container', 0); $elementText = $element->find('.text-container', 0);
// don't forget to replace images server url with gq one // don't forget to replace images server url with gq one
foreach($elementText->find('img') as $image) { foreach($elementText->find('img') as $image) {

View file

@ -7,7 +7,7 @@ class SiliconBridge extends BridgeAbstract {
$this->name = "Silicon.fr"; $this->name = "Silicon.fr";
$this->uri = "http://www.silicon.fr/"; $this->uri = "http://www.silicon.fr/";
$this->description = "Returns the newest articles."; $this->description = "Returns the newest articles.";
$this->update = "2015-09-08"; $this->update = "2016-08-09";
} }
@ -48,7 +48,6 @@ class SiliconBridge extends BridgeAbstract {
//Build and add final item //Build and add final item
$item = new \Item(); $item = new \Item();
$item->uri = $article_uri; $item->uri = $article_uri;
$item->thumbnailUri = $thumbnailUri;
$item->title = StripCDATA($element->find('title', 0)->innertext); $item->title = StripCDATA($element->find('title', 0)->innertext);
$item->author = StripCDATA($element->find('dc:creator', 0)->innertext); $item->author = StripCDATA($element->find('dc:creator', 0)->innertext);
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);

View file

@ -10,7 +10,7 @@ class SoundCloudBridge extends BridgeAbstract{
$this->name = "Soundcloud Bridge"; $this->name = "Soundcloud Bridge";
$this->uri = "http://www.soundcloud.com/"; $this->uri = "http://www.soundcloud.com/";
$this->description = "Returns 10 newest music from user profile"; $this->description = "Returns 10 newest music from user profile";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -40,7 +40,7 @@ class SoundCloudBridge extends BridgeAbstract{
for ($i=0; $i < 10; $i++) { for ($i=0; $i < 10; $i++) {
$item = new \Item(); $item = new \Item();
$item->name = $tracks[$i]->user->username .' - '. $tracks[$i]->title; $item->author = $tracks[$i]->user->username .' - '. $tracks[$i]->title;
$item->title = $tracks[$i]->user->username .' - '. $tracks[$i]->title; $item->title = $tracks[$i]->user->username .' - '. $tracks[$i]->title;
$item->content = '<audio src="'. $tracks[$i]->uri .'/stream?client_id='. self::CLIENT_ID .'">'; $item->content = '<audio src="'. $tracks[$i]->uri .'/stream?client_id='. self::CLIENT_ID .'">';
$item->id = 'https://soundcloud.com/'. urlencode($this->request) .'/'. urlencode($tracks[$i]->permalink); $item->id = 'https://soundcloud.com/'. urlencode($this->request) .'/'. urlencode($tracks[$i]->permalink);

View file

@ -12,7 +12,7 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{
$this->name = 'Stripe API Changelog'; $this->name = 'Stripe API Changelog';
$this->uri = ''; $this->uri = '';
$this->description = 'Returns the changes made to the stripe.com API'; $this->description = 'Returns the changes made to the stripe.com API';
$this->update = '2016-06-20'; $this->update = '2016-08-09';
} }
public function collectData(array $param){ public function collectData(array $param){
@ -24,7 +24,7 @@ class StripeAPIChangeLogBridge extends BridgeAbstract{
$item=new \Item(); $item=new \Item();
$item->title=trim($change->plaintext); $item->title=trim($change->plaintext);
$item->uri='https://stripe.com/docs/upgrades#'.$item->title; $item->uri='https://stripe.com/docs/upgrades#'.$item->title;
$item->name='stripe'; $item->author='stripe';
$item->content=$change->nextSibling()->outertext; $item->content=$change->nextSibling()->outertext;
$item->timestamp=strtotime($item->title); $item->timestamp=strtotime($item->title);
$this->items[]=$item; $this->items[]=$item;

View file

@ -10,7 +10,7 @@ class SuperbWallpapersBridge extends BridgeAbstract {
$this->name = "Superb Wallpapers Bridge"; $this->name = "Superb Wallpapers Bridge";
$this->uri = "http://www.superbwallpapers.com/"; $this->uri = "http://www.superbwallpapers.com/";
$this->description = "Returns the latests wallpapers from SuperbWallpapers"; $this->description = "Returns the latests wallpapers from SuperbWallpapers";
$this->update = "2015-04-08"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -61,7 +61,6 @@ class SuperbWallpapersBridge extends BridgeAbstract {
$item->uri = str_replace('200x125', $this->resolution, $thumbnail->src); $item->uri = str_replace('200x125', $this->resolution, $thumbnail->src);
$item->timestamp = time(); $item->timestamp = time();
$item->title = $element->title; $item->title = $element->title;
$item->thumbnailUri = $thumbnail->src;
$item->content = $item->title.'<br><a href="'.$item->uri.'">'.$thumbnail.'</a>'; $item->content = $item->title.'<br><a href="'.$item->uri.'">'.$thumbnail.'</a>';
$this->items[] = $item; $this->items[] = $item;

View file

@ -7,7 +7,7 @@ class T411Bridge extends BridgeAbstract {
$this->name = 'T411'; $this->name = 'T411';
$this->uri = $this->getURI(); $this->uri = $this->getURI();
$this->description = 'Returns the 10 newest torrents with specified search terms <br /> Use url part after "?" mark when using their search engine.'; $this->description = 'Returns the 10 newest torrents with specified search terms <br /> Use url part after "?" mark when using their search engine.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
'[ '[
@ -63,15 +63,6 @@ class T411Bridge extends BridgeAbstract {
$item_desc = $item_html->find('div.description', 0); $item_desc = $item_html->find('div.description', 0);
$item_author = $item_html->find('a.profile', 0)->innertext; $item_author = $item_html->find('a.profile', 0)->innertext;
//Retrieve image for thumbnail or generic logo fallback
$item_image = $this->getURI().'themes/blue/images/logo.png';
foreach ($item_desc->find('img') as $img) {
if (strpos($img->src, 'prez') === false && strpos($img->src, '/ad/') === false) {
$item_image = $img->src;
break;
}
}
//Cleanup advertisments //Cleanup advertisments
$divs = explode('<div class="align-center">', $item_desc->innertext); $divs = explode('<div class="align-center">', $item_desc->innertext);
$item_desc = ''; $item_desc = '';
@ -86,7 +77,6 @@ class T411Bridge extends BridgeAbstract {
$item->title = $item_title; $item->title = $item_title;
$item->author = $item_author; $item->author = $item_author;
$item->timestamp = $item_date; $item->timestamp = $item_date;
$item->thumbnailUri = $item_image;
$item->content = $item_desc; $item->content = $item_desc;
$this->items[] = $item; $this->items[] = $item;
$limit++; $limit++;

View file

@ -7,7 +7,7 @@ class TagBoardBridge extends BridgeAbstract{
$this->name = "TagBoard"; $this->name = "TagBoard";
$this->uri = "http://www.TagBoard.com"; $this->uri = "http://www.TagBoard.com";
$this->description = "Returns most recent results from TagBoard."; $this->description = "Returns most recent results from TagBoard.";
$this->update = "2014-09-10"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -31,9 +31,9 @@ class TagBoardBridge extends BridgeAbstract{
$item = new Item(); $item = new Item();
$item->uri = $element->{'permalink'}; $item->uri = $element->{'permalink'};
$item->title = $element->{'text'}; $item->title = $element->{'text'};
$item->thumbnailUri = $element->{'photos'}[0]->{'m'}; $thumbnailUri = $element->{'photos'}[0]->{'m'};
if (isset($item->thumbnailUri)) { if (isset($thumbnailUri)) {
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a>'; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a>';
}else{ }else{
$item->content = $element->{'html'}; $item->content = $element->{'html'};
} }

View file

@ -7,7 +7,7 @@ class TbibBridge extends BridgeAbstract{
$this->name = "Tbib"; $this->name = "Tbib";
$this->uri = "http://tbib.org/"; $this->uri = "http://tbib.org/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -41,10 +41,10 @@ class TbibBridge extends BridgeAbstract{
$item->uri = 'http://tbib.org/'.$element->find('a', 0)->href; $item->uri = 'http://tbib.org/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src; $thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('alt'); $item->tags = $element->find('img', 0)->getAttribute('alt');
$item->title = 'Tbib | '.$item->postid; $item->title = 'Tbib | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class TheCodingLoveBridge extends BridgeAbstract{
$this->name = "The Coding Love"; $this->name = "The Coding Love";
$this->uri = "http://thecodinglove.com/"; $this->uri = "http://thecodinglove.com/";
$this->description = "The Coding Love"; $this->description = "The Coding Love";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
} }
@ -37,7 +37,7 @@ class TheCodingLoveBridge extends BridgeAbstract{
if($pos > 0) if($pos > 0)
{ {
$auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2)))); $auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2))));
$item->name = $auteur; $item->author = $auteur;
} }

View file

@ -7,7 +7,7 @@ class TheHackerNewsBridge extends BridgeAbstract {
$this->name = 'The Hacker News Bridge'; $this->name = 'The Hacker News Bridge';
$this->uri = 'https://thehackernews.com/'; $this->uri = 'https://thehackernews.com/';
$this->description = 'Cyber Security, Hacking, Technology News.'; $this->description = 'Cyber Security, Hacking, Technology News.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
} }
@ -55,7 +55,6 @@ class TheHackerNewsBridge extends BridgeAbstract {
$article_author = trim($element->find('span.vcard', 0)->plaintext); $article_author = trim($element->find('span.vcard', 0)->plaintext);
$article_title = $element->find('a.entry-title', 0)->plaintext; $article_title = $element->find('a.entry-title', 0)->plaintext;
$article_timestamp = strtotime($element->find('span.updated', 0)->plaintext); $article_timestamp = strtotime($element->find('span.updated', 0)->plaintext);
$article_thumbnail = $element->find('img', 0)->src;
$article = $this->file_get_html($article_url) or $this->returnError('Could not request TheHackerNews: '.$article_url, 500); $article = $this->file_get_html($article_url) or $this->returnError('Could not request TheHackerNews: '.$article_url, 500);
$contents = $article->find('div.articlebodyonly', 0)->innertext; $contents = $article->find('div.articlebodyonly', 0)->innertext;
@ -66,7 +65,6 @@ class TheHackerNewsBridge extends BridgeAbstract {
$item->uri = $article_url; $item->uri = $article_url;
$item->title = $article_title; $item->title = $article_title;
$item->author = $article_author; $item->author = $article_author;
$item->thumbnailUri = $article_thumbnail;
$item->timestamp = $article_timestamp; $item->timestamp = $article_timestamp;
$item->content = trim($contents); $item->content = trim($contents);
$this->items[] = $item; $this->items[] = $item;

View file

@ -10,7 +10,7 @@ class TheOatmealBridge extends RssExpander{
$this->name = "The Oatmeal"; $this->name = "The Oatmeal";
$this->uri = "http://theoatmeal.com/"; $this->uri = "http://theoatmeal.com/";
$this->description = "Un petit site de dessins assez rigolos"; $this->description = "Un petit site de dessins assez rigolos";
$this->update = "2015-07-03"; $this->update = "2016-08-09";
} }
@ -53,9 +53,9 @@ class TheOatmealBridge extends RssExpander{
$item->content = $content->innertext; $item->content = $content->innertext;
$this->message("dc content is ".var_export($dc, true)); $this->message("dc content is ".var_export($dc, true));
$item->name = (string) $dc->creator; $item->author = (string) $dc->creator;
$item->timestamp = DateTime::createFromFormat(DateTime::ISO8601, $dc->date)->getTimestamp(); $item->timestamp = DateTime::createFromFormat(DateTime::ISO8601, $dc->date)->getTimestamp();
$this->message("writtem by ".$item->name." on ".$item->timestamp); $this->message("writtem by ".$item->author." on ".$item->timestamp);
return $item; return $item;
} }

View file

@ -13,7 +13,7 @@ class TwitchApiBridge extends BridgeAbstract{
$this->name = "Twitch API Bridge"; $this->name = "Twitch API Bridge";
$this->uri = "http://www.twitch.tv"; $this->uri = "http://www.twitch.tv";
$this->description = "Returns the newest broadcasts or highlights by channel name using the Twitch API (v3)"; $this->description = "Returns the newest broadcasts or highlights by channel name using the Twitch API (v3)";
$this->update = "2016-01-09"; $this->update = "2016-08-09";
$this->parameters["Get channel without limit"] = $this->parameters["Get channel without limit"] =
'[ '[
@ -140,10 +140,9 @@ class TwitchApiBridge extends BridgeAbstract{
$item = new \Item(); $item = new \Item();
$item->id = $video->_id; $item->id = $video->_id;
$item->uri = $video->url; $item->uri = $video->url;
$item->thumbnailUri = $video->preview;
$item->title = htmlspecialchars($video->title); $item->title = htmlspecialchars($video->title);
$item->timestamp = strtotime($video->recorded_at); $item->timestamp = strtotime($video->recorded_at);
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>'; $item->content = '<a href="' . $item->uri . '"><img src="' . $video->preview . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>';
$this->items[] = $item; $this->items[] = $item;
// Stop once the number of requested items is reached // Stop once the number of requested items is reached

View file

@ -7,7 +7,7 @@ class UnsplashBridge extends BridgeAbstract {
$this->name = "Unsplash Bridge"; $this->name = "Unsplash Bridge";
$this->uri = "http://unsplash.com/"; $this->uri = "http://unsplash.com/";
$this->description = "Returns the latests photos from Unsplash"; $this->description = "Returns the latests photos from Unsplash";
$this->update = "2015-03-02"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -61,8 +61,7 @@ class UnsplashBridge extends BridgeAbstract {
$thumbnail->src).'.jpg'; // '.jpg' only for format hint $thumbnail->src).'.jpg'; // '.jpg' only for format hint
$item->timestamp = time(); $item->timestamp = time();
$item->title = $thumbnail->alt; $item->title = $thumbnail->alt;
$item->thumbnailUri = $thumbnail->src; $item->content = $item->title.'<br><a href="'.$item->uri.'"><img src="'.$thumbnail->src.'" /></a>';
$item->content = $item->title.'<br><a href="'.$item->uri.'"><img src="'.$item->thumbnailUri.'" /></a>';
$this->items[] = $item; $this->items[] = $item;
$num++; $num++;

View file

@ -7,7 +7,7 @@ class ViadeoCompany extends BridgeAbstract{
$this->name = "Viadeo Company"; $this->name = "Viadeo Company";
$this->uri = "https://www.viadeo.com/"; $this->uri = "https://www.viadeo.com/";
$this->description = "Returns most recent actus from Company on Viadeo. (http://www.viadeo.com/fr/company/<strong style=\"font-weight:bold;\">apple</strong>)"; $this->description = "Returns most recent actus from Company on Viadeo. (http://www.viadeo.com/fr/company/<strong style=\"font-weight:bold;\">apple</strong>)";
$this->update = "2015-12-22"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -30,8 +30,7 @@ class ViadeoCompany extends BridgeAbstract{
$item = new \Item(); $item = new \Item();
$item->uri = $link; $item->uri = $link;
$item->title = mb_substr($element->find('p', 0)->innertext, 0 ,100); $item->title = mb_substr($element->find('p', 0)->innertext, 0 ,100);
$item->content = $element->find('p', 0)->innertext; $item->content = $element->find('p', 0)->innertext;;
$item->thumbnailUri = str_replace('//', 'http://', $element->find('img.usage-article__image_only', 0)->src);
$this->items[] = $item; $this->items[] = $item;
$i++; $i++;
} }

View file

@ -11,7 +11,7 @@ class WallpaperStopBridge extends BridgeAbstract {
$this->name = "WallpaperStop Bridge"; $this->name = "WallpaperStop Bridge";
$this->uri = "http://www.wallpaperstop.com/"; $this->uri = "http://www.wallpaperstop.com/";
$this->description = "Returns the latests wallpapers from WallpaperStop"; $this->description = "Returns the latests wallpapers from WallpaperStop";
$this->update = "2014-11-05"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -73,8 +73,7 @@ class WallpaperStopBridge extends BridgeAbstract {
$item->id = $matches[3]; $item->id = $matches[3];
$item->timestamp = time(); $item->timestamp = time();
$item->title = $thumbnail->title; $item->title = $thumbnail->title;
$item->thumbnailUri = $baseUri.$thumbnail->src; $item->content = $item->title.'<br><a href="'.$wplink.'"><img src="'.$baseUri.$thumbnail->src.'" /></a>';
$item->content = $item->title.'<br><a href="'.$wplink.'"><img src="'.$item->thumbnailUri.'" /></a>';
$this->items[] = $item; $this->items[] = $item;
$num++; $num++;

View file

@ -6,7 +6,7 @@ class WeLiveSecurityBridge extends BridgeAbstract {
$this->name = 'We Live Security'; $this->name = 'We Live Security';
$this->uri = 'http://www.welivesecurity.com/'; $this->uri = 'http://www.welivesecurity.com/';
$this->description = 'Returns the newest articles.'; $this->description = 'Returns the newest articles.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
} }
public function collectData(array $param) { public function collectData(array $param) {
@ -49,7 +49,6 @@ class WeLiveSecurityBridge extends BridgeAbstract {
$item = new \Item(); $item = new \Item();
$item->uri = $article_url; $item->uri = $article_url;
$item->thumbnailUri = $article_image;
$item->title = $element->find('title', 0)->plaintext; $item->title = $element->find('title', 0)->plaintext;
$item->author = $article_html->find('a[rel=author]', 0)->plaintext; $item->author = $article_html->find('a[rel=author]', 0)->plaintext;
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);

View file

@ -10,7 +10,7 @@ class WhydBridge extends BridgeAbstract{
$this->name = "Whyd Bridge"; $this->name = "Whyd Bridge";
$this->uri = "http://www.whyd.com/"; $this->uri = "http://www.whyd.com/";
$this->description = "Returns 10 newest music from user profile"; $this->description = "Returns 10 newest music from user profile";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -48,7 +48,7 @@ class WhydBridge extends BridgeAbstract{
for($i = 0; $i < 10; $i++) { for($i = 0; $i < 10; $i++) {
$track = $html->find('div.post', $i); $track = $html->find('div.post', $i);
$item = new \Item(); $item = new \Item();
$item->name = $track->find('h2', 0)->plaintext; $item->author = $track->find('h2', 0)->plaintext;
$item->title = $track->find('h2', 0)->plaintext; $item->title = $track->find('h2', 0)->plaintext;
$item->content = $track->find('a.thumb',0) . '<br/>' . $track->find('h2', 0)->plaintext; $item->content = $track->find('a.thumb',0) . '<br/>' . $track->find('h2', 0)->plaintext;
$item->id = 'http://www.whyd.com' . $track->find('a.no-ajaxy',0)->getAttribute('href'); $item->id = 'http://www.whyd.com' . $track->find('a.no-ajaxy',0)->getAttribute('href');

View file

@ -12,7 +12,7 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{
$this->name = "World of Tanks"; $this->name = "World of Tanks";
$this->uri = "http://worldoftanks.eu/"; $this->uri = "http://worldoftanks.eu/";
$this->description = "News about the tank slaughter game."; $this->description = "News about the tank slaughter game.";
$this->update = "2016-08-06"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -89,7 +89,6 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{
HTMLSanitizer::defaultImageSrcTo($content, WORLD_OF_TANKS); HTMLSanitizer::defaultImageSrcTo($content, WORLD_OF_TANKS);
$item->title = $content->find('h1', 0)->innertext; $item->title = $content->find('h1', 0)->innertext;
$item->content = $content->find('.b-content', 0)->innertext; $item->content = $content->find('.b-content', 0)->innertext;
// $item->name = $auteur->innertext;
$item->timestamp = $content->find('.b-statistic_time', 0)->getAttribute("data-timestamp"); $item->timestamp = $content->find('.b-statistic_time', 0)->getAttribute("data-timestamp");
$this->items[] = $item; $this->items[] = $item;
} }

View file

@ -7,7 +7,7 @@ class XbooruBridge extends BridgeAbstract{
$this->name = "Xbooru"; $this->name = "Xbooru";
$this->uri = "http://xbooru.com/"; $this->uri = "http://xbooru.com/";
$this->description = "Returns images from given page"; $this->description = "Returns images from given page";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -41,10 +41,10 @@ class XbooruBridge extends BridgeAbstract{
$item->uri = 'http://xbooru.com/'.$element->find('a', 0)->href; $item->uri = 'http://xbooru.com/'.$element->find('a', 0)->href;
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id')); $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
$item->timestamp = time(); $item->timestamp = time();
$item->thumbnailUri = $element->find('img', 0)->src; $thumbnailUri = $element->find('img', 0)->src;
$item->tags = $element->find('img', 0)->getAttribute('alt'); $item->tags = $element->find('img', 0)->getAttribute('alt');
$item->title = 'Xbooru | '.$item->postid; $item->title = 'Xbooru | '.$item->postid;
$item->content = '<a href="' . $item->uri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$item->tags; $item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -7,7 +7,7 @@ class YandereBridge extends BridgeAbstract{
$this->name = "Yande.re"; $this->name = "Yande.re";
$this->uri = "https://yande.re/"; $this->uri = "https://yande.re/";
$this->description = "Returns images from given page and tags"; $this->description = "Returns images from given page and tags";
$this->update = "2014-05-25"; $this->update = "2016-08-09";
$this->parameters[] = $this->parameters[] =
'[ '[
@ -44,9 +44,8 @@ class YandereBridge extends BridgeAbstract{
$item->postid = $json['id']; $item->postid = $json['id'];
$item->timestamp = $json['created_at']; $item->timestamp = $json['created_at'];
$item->imageUri = $json['file_url']; $item->imageUri = $json['file_url'];
$item->thumbnailUri = $json['preview_url'];
$item->title = 'Yandere | '.$json['id']; $item->title = 'Yandere | '.$json['id'];
$item->content = '<a href="' . $item->imageUri . '"><img src="' . $item->thumbnailUri . '" /></a><br>Tags: '.$json['tags']; $item->content = '<a href="' . $item->imageUri . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
$this->items[] = $item; $this->items[] = $item;
} }
} }

View file

@ -14,7 +14,7 @@ class YoutubeBridge extends BridgeAbstract {
$this->homepage = $this->getURI(); $this->homepage = $this->getURI();
$this->description = 'Returns the 10 newest videos by username/channel/playlist or search'; $this->description = 'Returns the 10 newest videos by username/channel/playlist or search';
$this->maintainer = 'mitsukarenai'; $this->maintainer = 'mitsukarenai';
$this->update = '02/05/2016'; $this->update = '2016-08-09';
$this->parameters['By username'] = $this->parameters['By username'] =
'[ '[
@ -83,8 +83,8 @@ class YoutubeBridge extends BridgeAbstract {
$item->author = $author; $item->author = $author;
$item->timestamp = $time; $item->timestamp = $time;
$item->uri = $this->getURI().'watch?v='.$vid; $item->uri = $this->getURI().'watch?v='.$vid;
$item->thumbnailUri = str_replace('/www.', '/img.', $this->getURI()).'vi/'.$vid.'/0.jpg'; $thumbnailUri = str_replace('/www.', '/img.', $this->getURI()).'vi/'.$vid.'/0.jpg';
$item->content = '<a href="'.$item->uri.'"><img src="'.$item->thumbnailUri.'" /></a><br />'.$desc; $item->content = '<a href="'.$item->uri.'"><img src="'.$thumbnailUri.'" /></a><br />'.$desc;
$this->items[] = $item; $this->items[] = $item;
} }

View file

@ -7,7 +7,7 @@ class ZDNetBridge extends BridgeAbstract {
$this->name = 'ZDNet Bridge'; $this->name = 'ZDNet Bridge';
$this->uri = 'http://www.zdnet.com/'; $this->uri = 'http://www.zdnet.com/';
$this->description = 'Technology News, Analysis, Comments and Product Reviews for IT Professionals.'; $this->description = 'Technology News, Analysis, Comments and Product Reviews for IT Professionals.';
$this->update = '2016-08-06'; $this->update = '2016-08-09';
$this->parameters[] = $this->parameters[] =
// http://www.zdnet.com/zdnet.opml // http://www.zdnet.com/zdnet.opml
@ -286,14 +286,10 @@ class ZDNetBridge extends BridgeAbstract {
.'<p><b>'.$article_subtitle.'</b></p>' .'<p><b>'.$article_subtitle.'</b></p>'
.$contents; .$contents;
if ($thumbnail == '')
$thumbnail = 'http://zdnet1.cbsistatic.com/fly/bundles/zdnetcss/images/logos/logo-192x192.png';
$item = new \Item(); $item = new \Item();
$item->author = $author; $item->author = $author;
$item->uri = $article_url; $item->uri = $article_url;
$item->title = $article_title; $item->title = $article_title;
$item->thumbnailUri = $thumbnail;
$item->timestamp = $article_timestamp; $item->timestamp = $article_timestamp;
$item->content = $contents; $item->content = $contents;
$this->items[] = $item; $this->items[] = $item;

View file

@ -1,9 +1,4 @@
<?php <?php
function xml_encode($text) {
return htmlspecialchars($text, ENT_XML1);
}
/** /**
* Atom * Atom
* Documentation Source http://en.wikipedia.org/wiki/Atom_%28standard%29 and http://tools.ietf.org/html/rfc4287 * Documentation Source http://en.wikipedia.org/wiki/Atom_%28standard%29 and http://tools.ietf.org/html/rfc4287
@ -18,46 +13,32 @@ class AtomFormat extends FormatAbstract{
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ''; $httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
$serverRequestUri = xml_encode($_SERVER['REQUEST_URI']); $serverRequestUri = $this->xml_encode($_SERVER['REQUEST_URI']);
$extraInfos = $this->getExtraInfos(); $extraInfos = $this->getExtraInfos();
$title = xml_encode($extraInfos['name']); $title = $this->xml_encode($extraInfos['name']);
$uri = $extraInfos['uri']; $uri = !empty($extraInfos['uri']) ? $extraInfos['uri'] : 'https://github.com/sebsauvage/rss-bridge';
$icon = xml_encode('http://icons.better-idea.org/icon?url='. $uri .'&size=64'); $icon = $this->xml_encode('http://icons.better-idea.org/icon?url='. $uri .'&size=64');
$uri = xml_encode($uri); $uri = $this->xml_encode($uri);
$entries = ''; $entries = '';
foreach($this->getDatas() as $data){ foreach($this->getDatas() as $data){
$entryName = is_null($data->name) ? $title : xml_encode($data->name); $entryAuthor = is_null($data->author) ? '' : $this->xml_encode($data->author);
$entryAuthor = is_null($data->author) ? $uri : xml_encode($data->author); $entryTitle = is_null($data->title) ? '' : $this->xml_encode($data->title);
$entryTitle = is_null($data->title) ? '' : xml_encode($data->title); $entryUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri);
$entryUri = is_null($data->uri) ? '' : xml_encode($data->uri); $entryTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_ATOM, $data->timestamp));
$entryTimestamp = is_null($data->timestamp) ? '' : xml_encode(date(DATE_ATOM, $data->timestamp)); $entryContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content));
// We prevent content from closing the CDATA too early.
$entryContent = is_null($data->content) ? '' : '<![CDATA[' . $this->sanitizeHtml(str_replace(']]>','',$data->content)) . ']]>';
// We generate a list of the enclosure links
$entryEnclosures = "";
foreach($data->enclosures as $enclosure) {
$entryEnclosures .= "<link rel=\"enclosure\" href=\"".$enclosure."\"></link>";
}
$entries .= <<<EOD $entries .= <<<EOD
<entry> <entry>
<author> <author>
<name>{$entryName}</name> <name>{$entryAuthor}</name>
<uri>{$entryAuthor}</uri>
</author> </author>
<title type="html"><![CDATA[{$entryTitle}]]></title> <title type="html"><![CDATA[{$entryTitle}]]></title>
<link rel="alternate" type="text/html" href="{$entryUri}" /> <link rel="alternate" type="text/html" href="{$entryUri}" />
<id>{$entryUri}</id> <id>{$entryUri}</id>
<updated>{$entryTimestamp}</updated> <updated>{$entryTimestamp}</updated>
<content type="html">{$entryContent}</content> <content type="html">{$entryContent}</content>
{$entryEnclosures}
</entry> </entry>
EOD; EOD;
@ -108,4 +89,8 @@ EOD;
return parent::display(); return parent::display();
} }
private function xml_encode($text) {
return htmlspecialchars($text, ENT_XML1);
}
} }

View file

@ -12,22 +12,23 @@ class HtmlFormat extends FormatAbstract{
$extraInfos = $this->getExtraInfos(); $extraInfos = $this->getExtraInfos();
$title = htmlspecialchars($extraInfos['name']); $title = htmlspecialchars($extraInfos['name']);
$uri = htmlspecialchars($extraInfos['uri']); $uri = htmlspecialchars($extraInfos['uri']);
$atomquery = str_replace('format=HtmlFormat', 'format=AtomFormat', htmlentities($_SERVER['QUERY_STRING'])); $atomquery = str_replace('format=HtmlFormat', 'format=AtomFormat', htmlentities($_SERVER['QUERY_STRING']));
$mrssquery = str_replace('format=HtmlFormat', 'format=MrssFormat', htmlentities($_SERVER['QUERY_STRING']));
$entries = ''; $entries = '';
foreach($this->getDatas() as $data){ foreach($this->getDatas() as $data){
$entryUri = is_null($data->uri) ? $uri : $data->uri;
$entryTitle = is_null($data->title) ? '' : $this->sanitizeHtml(strip_tags($data->title));
$entryTimestamp = is_null($data->timestamp) ? '' : '<time datetime="' . date(DATE_ATOM, $data->timestamp) . '">' . date(DATE_ATOM, $data->timestamp) . '</time>';
$entryAuthor = is_null($data->author) ? '' : '<br /><p class="author">by: ' . $data->author . '</p>'; $entryAuthor = is_null($data->author) ? '' : '<br /><p class="author">by: ' . $data->author . '</p>';
$entryTitle = is_null($data->title) ? '' : $this->sanitizeHtml(strip_tags($data->title));
$entryUri = is_null($data->uri) ? $uri : $data->uri;
$entryTimestamp = is_null($data->timestamp) ? '' : '<time datetime="' . date(DATE_ATOM, $data->timestamp) . '">' . date(DATE_ATOM, $data->timestamp) . '</time>';
$entryContent = is_null($data->content) ? '' : '<div class="content">' . $this->sanitizeHtml($data->content). '</div>'; $entryContent = is_null($data->content) ? '' : '<div class="content">' . $this->sanitizeHtml($data->content). '</div>';
$entries .= <<<EOD $entries .= <<<EOD
<section class="feeditem"> <section class="feeditem">
<h2><a class="itemtitle" href="{$entryUri}">{$entryTitle}</a></h2> <h2><a class="itemtitle" href="{$entryUri}">{$entryTitle}</a></h2>
{$entryTimestamp} {$entryTimestamp}
{$entryAuthor} {$entryAuthor}
{$entryContent} {$entryContent}
</section> </section>
EOD; EOD;
@ -39,14 +40,18 @@ EOD;
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>{$title}</title> <title>{$title}</title>
<link href="css/HtmlFormat.css" rel="stylesheet"> <link href="css/HtmlFormat.css" rel="stylesheet">
<meta name="robots" content="noindex, follow"> <meta name="robots" content="noindex, follow">
</head> </head>
<body> <body>
<h1 class="pagetitle"><a href="{$uri}" target="_blank">{$title}</a></h1> <h1 class="pagetitle"><a href="{$uri}" target="_blank">{$title}</a></h1>
<div class="buttons"><a href="./#bridge-{$_GET['bridge']}"><button class="backbutton"> back to rss-bridge</button></a><a href="./?{$atomquery}"><button class="rss-feed">RSS feed</button></a></div> <div class="buttons">
<a href="./#bridge-{$_GET['bridge']}"><button class="backbutton"> back to rss-bridge</button></a>
<a href="./?{$atomquery}"><button class="rss-feed">RSS feed (ATOM)</button></a>
<a href="./?{$mrssquery}"><button class="rss-feed">RSS feed (MRSS)</button></a>
</div>
{$entries} {$entries}
</body> </body>
</html> </html>

View file

@ -13,23 +13,19 @@ class MrssFormat extends FormatAbstract{
$httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ''; $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
$httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : ''; $httpInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
$serverRequestUri = htmlspecialchars($_SERVER['REQUEST_URI']); $serverRequestUri = $this->xml_encode($_SERVER['REQUEST_URI']);
$extraInfos = $this->getExtraInfos(); $extraInfos = $this->getExtraInfos();
$title = htmlspecialchars($extraInfos['name']); $title = $this->xml_encode($extraInfos['name']);
$uri = htmlspecialchars($extraInfos['uri']); $uri = $this->xml_encode(!empty($extraInfos['uri']) ? $extraInfos['uri'] : 'https://github.com/sebsauvage/rss-bridge');
$icon = 'http://g.etfv.co/'. $uri .'?icon.jpg';
$items = ''; $items = '';
foreach($this->getDatas() as $data){ foreach($this->getDatas() as $data){
$itemTitle = strip_tags(is_null($data->title) ? '' : $data->title); $itemAuthor = is_null($data->author) ? '' : $this->xml_encode($data->author);
$itemUri = is_null($data->uri) ? '' : $data->uri; $itemTitle = strip_tags(is_null($data->title) ? '' : $this->xml_encode($data->title));
$itemAuthor = is_null($data->author) ? '' : $data->author; $itemUri = is_null($data->uri) ? '' : $this->xml_encode($data->uri);
$itemThumbnailUri = is_null($data->thumbnailUri) ? '' : $data->thumbnailUri; $itemTimestamp = is_null($data->timestamp) ? '' : $this->xml_encode(date(DATE_RFC2822, $data->timestamp));
$itemTimestamp = is_null($data->timestamp) ? '' : date(DATE_RFC2822, $data->timestamp); $itemContent = is_null($data->content) ? '' : $this->xml_encode($this->sanitizeHtml($data->content));
// We prevent content from closing the CDATA too early.
$itemContent = is_null($data->content) ? '' : htmlspecialchars($this->sanitizeHtml(str_replace(']]>','',$data->content)));
$items .= <<<EOD $items .= <<<EOD
<item> <item>
@ -39,8 +35,6 @@ class MrssFormat extends FormatAbstract{
<pubDate>{$itemTimestamp}</pubDate> <pubDate>{$itemTimestamp}</pubDate>
<description>{$itemContent}</description> <description>{$itemContent}</description>
<author>{$itemAuthor}</author> <author>{$itemAuthor}</author>
<media:title>{$itemTitle}</media:title>
<media:thumbnail url="{$itemThumbnailUri}" />
</item> </item>
EOD; EOD;
@ -59,8 +53,9 @@ EOD;
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom"> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
<title>{$title}</title> <title>{$title}</title>
<link>{$uri}/</link> <link>http{$https}://{$httpHost}{$httpInfo}/</link>
<description>{$title}</description> <description>{$title}</description>
<atom:link rel="alternate" type="text/html" href="{$uri}" />
<atom:link rel="self" href="http{$https}://{$httpHost}{$serverRequestUri}" /> <atom:link rel="self" href="http{$https}://{$httpHost}{$serverRequestUri}" />
{$items} {$items}
</channel> </channel>
@ -85,4 +80,8 @@ EOD;
return parent::display(); return parent::display();
} }
private function xml_encode($text) {
return htmlspecialchars($text, ENT_XML1);
}
} }