mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-22 01:25:28 +03:00
[bridges] Change all occurrences of the Item object to array
This commit is contained in:
parent
1f3361c6b4
commit
bf0a9d754e
130 changed files with 844 additions and 844 deletions
|
@ -19,12 +19,12 @@ class ABCTabsBridge extends BridgeAbstract{
|
|||
|
||||
foreach ($table->find('tr') as $tab)
|
||||
{
|
||||
$item = new \Item();
|
||||
$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->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->uri = 'http://www.abc-tabs.com' . $tab->find('td', 2)->find('a', 0)->getAttribute('href');
|
||||
$item = array();
|
||||
$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['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['uri'] = 'http://www.abc-tabs.com' . $tab->find('td', 2)->find('a', 0)->getAttribute('href');
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,16 +23,16 @@ class AcrimedBridge extends RssExpander{
|
|||
$namespaces = $newsItem->getNameSpaces(true);
|
||||
$dc = $newsItem->children($namespaces['dc']);
|
||||
|
||||
$item = new Item();
|
||||
$item->uri = trim($newsItem->link);
|
||||
$item->title = trim($newsItem->title);
|
||||
$item->timestamp = strtotime($dc->date);
|
||||
$item = array();
|
||||
$item['uri'] = trim($newsItem->link);
|
||||
$item['title'] = trim($newsItem->title);
|
||||
$item['timestamp'] = strtotime($dc->date);
|
||||
|
||||
$articlePage = $this->getSimpleHTMLDOM($newsItem->link);
|
||||
$article = $hs->sanitize($articlePage->find('article.article1', 0)->innertext);
|
||||
$article = HTMLSanitizer::defaultImageSrcTo($article, "http://www.acrimed.org/");
|
||||
|
||||
$item->content = $article;
|
||||
$item['content'] = $article;
|
||||
|
||||
|
||||
return $item;
|
||||
|
|
|
@ -55,7 +55,7 @@ class AllocineFRBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('figure.media-meta-fig') as $element)
|
||||
{
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
|
||||
$title = $element->find('div.titlebar h3.title a', 0);
|
||||
$content = trim($element->innertext);
|
||||
|
@ -67,9 +67,9 @@ class AllocineFRBridge extends BridgeAbstract{
|
|||
$content = str_replace('href="/', 'href="http://www.allocine.fr/', $content);
|
||||
$content = str_replace('src=\'/', 'src=\'http://www.allocine.fr/', $content);
|
||||
$content = str_replace('href=\'/', 'href=\'http://www.allocine.fr/', $content);
|
||||
$item->content = $content;
|
||||
$item->title = trim($title->innertext);
|
||||
$item->uri = "http://www.allocine.fr" . $title->href;
|
||||
$item['content'] = $content;
|
||||
$item['title'] = trim($title->innertext);
|
||||
$item['uri'] = "http://www.allocine.fr" . $title->href;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,12 +83,12 @@ class AnimeUltimeBridge extends BridgeAbstract {
|
|||
$item_description = utf8_encode($item_description);
|
||||
|
||||
//Build and add final item
|
||||
$item = new \Item();
|
||||
$item->uri = $item_uri;
|
||||
$item->title = $item_name.' '.$item_type.' '.$item_episode;
|
||||
$item->author = $item_fansub;
|
||||
$item->timestamp = $item_date;
|
||||
$item->content = $item_description;
|
||||
$item = array();
|
||||
$item['uri'] = $item_uri;
|
||||
$item['title'] = $item_name.' '.$item_type.' '.$item_episode;
|
||||
$item['author'] = $item_fansub;
|
||||
$item['timestamp'] = $item_date;
|
||||
$item['content'] = $item_description;
|
||||
$this->items[] = $item;
|
||||
$processedOK++;
|
||||
|
||||
|
|
|
@ -49,13 +49,13 @@ class ArstechnicaBridge extends BridgeAbstract {
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = $this->StripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = $this->StripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->author = $this->StripCDATA($element->find('author', 0)->innertext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->ExtractContent($item->uri);
|
||||
//$item->content = $item->uri;
|
||||
$item = array();
|
||||
$item['title'] = $this->StripCDATA($element->find('title', 0)->innertext);
|
||||
$item['uri'] = $this->StripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item['author'] = $this->StripCDATA($element->find('author', 0)->innertext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->ExtractContent($item['uri']);
|
||||
//$item['content'] = $item['uri'];
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -76,18 +76,18 @@ class Arte7Bridge extends BridgeAbstract{
|
|||
$input_json = extractVideoset($category, $lang);
|
||||
|
||||
foreach($input_json['videos'] as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = str_replace("autoplay=1", "", $element['url']);
|
||||
$item->id = $element['id'];
|
||||
$item = array();
|
||||
$item['uri'] = str_replace("autoplay=1", "", $element['url']);
|
||||
$item['id'] = $element['id'];
|
||||
$hack_broadcast_time = $element['rights_end'];
|
||||
$hack_broadcast_time = strtok($hack_broadcast_time, 'T');
|
||||
$hack_broadcast_time = strtok('T');
|
||||
$item->timestamp = strtotime($element['scheduled_on'].'T'.$hack_broadcast_time);
|
||||
$item->title = $element['title'];
|
||||
$item['timestamp'] = strtotime($element['scheduled_on'].'T'.$hack_broadcast_time);
|
||||
$item['title'] = $element['title'];
|
||||
if (!empty($element['subtitle']))
|
||||
$item->title = $element['title'].' | '.$element['subtitle'];
|
||||
$item->duration = round((int)$element['duration']/60);
|
||||
$item->content = $element['teaser'].'<br><br>'.$item->duration.'min<br><a href="'.$item->uri.'"><img src="' . $element['thumbnail_url'] . '" /></a>';
|
||||
$item['title'] = $element['title'].' | '.$element['subtitle'];
|
||||
$item['duration'] = round((int)$element['duration']/60);
|
||||
$item['content'] = $element['teaser'].'<br><br>'.$item['duration'].'min<br><a href="'.$item['uri'].'"><img src="' . $element['thumbnail_url'] . '" /></a>';
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,12 +26,12 @@ class AskfmBridge extends BridgeAbstract{
|
|||
}
|
||||
|
||||
foreach($html->find('div.streamItem-answer') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://ask.fm'.$element->find('a.streamItemsAge',0)->href;
|
||||
$item = array();
|
||||
$item['uri'] = 'http://ask.fm'.$element->find('a.streamItemsAge',0)->href;
|
||||
$question = trim($element->find('h1.streamItemContent-question',0)->innertext);
|
||||
$item->title = trim(htmlspecialchars_decode($element->find('h1.streamItemContent-question',0)->plaintext, ENT_QUOTES));
|
||||
$item['title'] = trim(htmlspecialchars_decode($element->find('h1.streamItemContent-question',0)->plaintext, ENT_QUOTES));
|
||||
$answer = trim($element->find('p.streamItemContent-answer',0)->innertext);
|
||||
#$item->update = $element->find('a.streamitemsage',0)->data-hint; // Doesn't work, DOM parser doesn't seem to like data-hint, dunno why
|
||||
#$item['update'] = $element->find('a.streamitemsage',0)->data-hint; // Doesn't work, DOM parser doesn't seem to like data-hint, dunno why
|
||||
$visual = $element->find('div.streamItemContent-visual',0)->innertext; // This probably should be cleaned up, especially for YouTube embeds
|
||||
//Fix tracking links, also doesn't work
|
||||
foreach($element->find('a') as $link) {
|
||||
|
@ -43,7 +43,7 @@ class AskfmBridge extends BridgeAbstract{
|
|||
$content = '<p>' . $question . '</p><p>' . $answer . '</p><p>' . $visual . '</p>';
|
||||
// Fix relative links without breaking // scheme used by YouTube stuff
|
||||
$content = preg_replace('#href="\/(?!\/)#', 'href="http://ask.fm/',$content);
|
||||
$item->content = $content;
|
||||
$item['content'] = $content;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,12 +33,12 @@ class BandcampBridge extends BridgeAbstract{
|
|||
$uri = ltrim($script, "return 'url(");
|
||||
$uri = rtrim($uri, "')");
|
||||
|
||||
$item = new \Item();
|
||||
$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->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->uri = $release->find('a',0)->getAttribute('href');
|
||||
$item = array();
|
||||
$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['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['uri'] = $release->find('a',0)->getAttribute('href');
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ class BastaBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 10) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('title', 0)->innertext;
|
||||
$item->uri = $element->find('guid', 0)->plaintext;
|
||||
$item->timestamp = strtotime($element->find('dc:date', 0)->plaintext);
|
||||
$item->content = ReplaceImageUrl($this->getSimpleHTMLDOM($item->uri)->find('div.texte', 0)->innertext);
|
||||
$item = array();
|
||||
$item['title'] = $element->find('title', 0)->innertext;
|
||||
$item['uri'] = $element->find('guid', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($element->find('dc:date', 0)->plaintext);
|
||||
$item['content'] = ReplaceImageUrl($this->getSimpleHTMLDOM($item['uri'])->find('div.texte', 0)->innertext);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -14,18 +14,18 @@ class BlaguesDeMerdeBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM('http://www.blaguesdemerde.fr/') or $this->returnServerError('Could not request BDM.');
|
||||
|
||||
foreach($html->find('article.joke_contener') as $element) {
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
$temp = $element->find('a');
|
||||
if(isset($temp[2]))
|
||||
{
|
||||
$item->content = trim($element->find('div.joke_text_contener', 0)->innertext);
|
||||
$item['content'] = trim($element->find('div.joke_text_contener', 0)->innertext);
|
||||
$uri = $temp[2]->href;
|
||||
$item->uri = $uri;
|
||||
$item->title = substr($uri, (strrpos($uri, "/") + 1));
|
||||
$item['uri'] = $uri;
|
||||
$item['title'] = substr($uri, (strrpos($uri, "/") + 1));
|
||||
$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));
|
||||
$item->timestamp = $time;
|
||||
$item->author = $element->find("li.bdm_pseudo",0)->innertext;;
|
||||
$item['timestamp'] = $time;
|
||||
$item['author'] = $element->find("li.bdm_pseudo",0)->innertext;;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,13 +36,13 @@ class BooruprojectBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=content] span') as $element) {
|
||||
$item = new \Item();
|
||||
$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->timestamp = time();
|
||||
$item->tags = $element->find('img', 0)->getAttribute('title');
|
||||
$item->title = 'Booruproject '.$param['i'].' | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $element->find('img', 0)->src . '" /></a><br>Tags: '.$item->tags;
|
||||
$item = array();
|
||||
$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['timestamp'] = time();
|
||||
$item['tags'] = $element->find('img', 0)->getAttribute('title');
|
||||
$item['title'] = 'Booruproject '.$param['i'].' | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $element->find('img', 0)->src . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,12 +48,12 @@ class CADBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('title', 0)->innertext;
|
||||
$item->uri = CADUrl($element->find('description', 0)->innertext);
|
||||
if ($item->uri != 'notanurl') {
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->CADExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $element->find('title', 0)->innertext;
|
||||
$item['uri'] = CADUrl($element->find('description', 0)->innertext);
|
||||
if ($item['uri'] != 'notanurl') {
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->CADExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -63,12 +63,12 @@ class CNETBridge extends BridgeAbstract {
|
|||
|
||||
$article_content = trim(CleanArticle(ExtractFromDelimiters($article_html, '<div class="articleContent', '<footer>')));
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $article_uri;
|
||||
$item->title = $article_title;
|
||||
$item->author = $article_author;
|
||||
$item->timestamp = $article_timestamp;
|
||||
$item->content = $article_content;
|
||||
$item = array();
|
||||
$item['uri'] = $article_uri;
|
||||
$item['title'] = $article_title;
|
||||
$item['author'] = $article_author;
|
||||
$item['timestamp'] = $article_timestamp;
|
||||
$item['content'] = $article_content;
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -91,19 +91,19 @@ class CastorusBridge extends BridgeAbstract {
|
|||
$this->returnServerError('Failed to find activities!');
|
||||
|
||||
foreach($activities as $activity){
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->title = $this->ExtractActivityTitle($activity);
|
||||
$item->uri = $this->ExtractActivityUrl($activity);
|
||||
$item->timestamp = $this->ExtractActivityTime($activity);
|
||||
$item->content = '<a href="' . $item->uri . '">' . $item->title . '</a><br><p>'
|
||||
$item['title'] = $this->ExtractActivityTitle($activity);
|
||||
$item['uri'] = $this->ExtractActivityUrl($activity);
|
||||
$item['timestamp'] = $this->ExtractActivityTime($activity);
|
||||
$item['content'] = '<a href="' . $item['uri'] . '">' . $item['title'] . '</a><br><p>'
|
||||
. $this->ExtractActivityPrice($activity) . '</p>';
|
||||
|
||||
if(isset($zip_filter) && !(substr($item->title, 0, strlen($zip_filter)) === $zip_filter)){
|
||||
if(isset($zip_filter) && !(substr($item['title'], 0, strlen($zip_filter)) === $zip_filter)){
|
||||
continue; // Skip this item
|
||||
}
|
||||
|
||||
if(isset($city_filter) && !(substr($item->title, strpos($item->title, ' ') + 1, strlen($city_filter)) === $city_filter)){
|
||||
if(isset($city_filter) && !(substr($item['title'], strpos($item['title'], ' ') + 1, strlen($city_filter)) === $city_filter)){
|
||||
continue; // Skip this item
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ class CollegeDeFranceBridge extends BridgeAbstract{
|
|||
*/
|
||||
$html = $this->getSimpleHTMLDOM('http://www.college-de-france.fr/components/search-audiovideo.jsp?fulltext=&siteid=1156951719600&lang=FR&type=all') or $this->returnServerError('Could not request CollegeDeFrance.');
|
||||
foreach($html->find('a[data-target]') as $element) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('.title', 0)->plaintext;
|
||||
$item = array();
|
||||
$item['title'] = $element->find('.title', 0)->plaintext;
|
||||
// Most relative URLs contains an hour in addition to the date, so let's use it
|
||||
// <a href="/site/yann-lecun/course-2016-04-08-11h00.htm" data-target="after">
|
||||
//
|
||||
|
@ -46,9 +46,9 @@ class CollegeDeFranceBridge extends BridgeAbstract{
|
|||
$timezone = new DateTimeZone('Europe/Paris');
|
||||
// strpos($element->href, '201') will break in 2020 but it'll probably break prior to then due to site changes anyway
|
||||
$d = DateTime::createFromFormat('!Y-m-d-H\hi', substr($element->href, strpos($element->href, '201'), 16), $timezone) ?: DateTime::createFromFormat('!d m Y', trim(str_replace(array_values($months), array_keys($months), $element->find('.date', 0)->plaintext)), $timezone);
|
||||
$item->timestamp = $d->format('U');
|
||||
$item->content = $element->find('.lecturer', 0)->innertext . ' - ' . $element->find('.title', 0)->innertext;
|
||||
$item->uri = 'http://www.college-de-france.fr' . $element->href;
|
||||
$item['timestamp'] = $d->format('U');
|
||||
$item['content'] = $element->find('.lecturer', 0)->innertext . ' - ' . $element->find('.title', 0)->innertext;
|
||||
$item['uri'] = 'http://www.college-de-france.fr' . $element->href;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,11 +28,11 @@ class CommonDreamsBridge extends BridgeAbstract{
|
|||
$limit = 0;
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 4) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('title', 0)->innertext;
|
||||
$item->uri = CommonDreamsUrl($element->find('guid', 0)->innertext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->CommonDreamsExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $element->find('title', 0)->innertext;
|
||||
$item['uri'] = CommonDreamsUrl($element->find('guid', 0)->innertext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->CommonDreamsExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -21,21 +21,21 @@ class CopieDoubleBridge extends BridgeAbstract{
|
|||
$cpt++;
|
||||
if($td->class == "couleur_1")
|
||||
{
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
|
||||
$title = $td->innertext;
|
||||
$pos = strpos($title, "<a");
|
||||
$title = substr($title, 0, $pos);
|
||||
$item->title = $title;
|
||||
$item['title'] = $title;
|
||||
}
|
||||
elseif(strpos($element->innertext, "/images/suivant.gif") === false)
|
||||
{
|
||||
$a=$element->find("a", 0);
|
||||
$item->uri = "http://www.copie-double.com" . $a->href;
|
||||
$item['uri'] = "http://www.copie-double.com" . $a->href;
|
||||
|
||||
$content = str_replace('src="/', 'src="http://www.copie-double.com/',$element->find("td", 0)->innertext);
|
||||
$content = str_replace('href="/', 'href="http://www.copie-double.com/',$content);
|
||||
$item->content = $content;
|
||||
$item['content'] = $content;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,24 +24,24 @@ class CourrierInternationalBridge extends BridgeAbstract{
|
|||
|
||||
foreach($element as $article) {
|
||||
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->uri = $article->parent->getAttribute("href");
|
||||
$item['uri'] = $article->parent->getAttribute("href");
|
||||
|
||||
if(strpos($item->uri, "http") === FALSE) {
|
||||
$item->uri = "http://courrierinternational.fr/".$item->uri;
|
||||
if(strpos($item['uri'], "http") === FALSE) {
|
||||
$item['uri'] = "http://courrierinternational.fr/".$item['uri'];
|
||||
}
|
||||
|
||||
$page = $this->getSimpleHTMLDOM($item->uri);
|
||||
$page = $this->getSimpleHTMLDOM($item['uri']);
|
||||
|
||||
$cleaner = new HTMLSanitizer();
|
||||
|
||||
$item->content = $cleaner->sanitize($page->find("div.article-text")[0]);
|
||||
$item->title = strip_tags($article->find(".title")[0]);
|
||||
$item['content'] = $cleaner->sanitize($page->find("div.article-text")[0]);
|
||||
$item['title'] = strip_tags($article->find(".title")[0]);
|
||||
|
||||
$dateTime = date_parse($page->find("time")[0]);
|
||||
|
||||
$item->timestamp = mktime(
|
||||
$item['timestamp'] = mktime(
|
||||
$dateTime['hour'],
|
||||
$dateTime['minute'],
|
||||
$dateTime['second'],
|
||||
|
|
|
@ -53,20 +53,20 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
|
|||
|
||||
$htmlepisode=content_get_html($this->get_cached($episode->find('a', 0)->getAttribute('href')));
|
||||
|
||||
$item = new \Item();
|
||||
$item->author = $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 = array();
|
||||
$item['author'] = $episode->find('a', 0)->text();
|
||||
$item['title'] = $episode->find('a', 0)->text();
|
||||
$item['timestamp'] = $this->get_cached_time($episode->find('a', 0)->getAttribute('href'));
|
||||
$textefiche=$htmlepisode->find('#textefiche', 0)->find('p',1);
|
||||
if (isset($textefiche)) {
|
||||
$item->content = $textefiche->text();
|
||||
$item['content'] = $textefiche->text();
|
||||
}
|
||||
else {
|
||||
$item->content = $htmlepisode->find('#textefiche', 0)->find('p',0)->text();
|
||||
$item['content'] = $htmlepisode->find('#textefiche', 0)->find('p',0)->text();
|
||||
}
|
||||
|
||||
$item->id = $episode->find('a', 0)->getAttribute('href');
|
||||
$item->uri = $this->uri . $htmlepisode->find('#telecharger',0)->getAttribute('href');
|
||||
$item['id'] = $episode->find('a', 0)->getAttribute('href');
|
||||
$item['uri'] = $this->uri . $htmlepisode->find('#telecharger',0)->getAttribute('href');
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ class CryptomeBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('pre') as $element) {
|
||||
for ( $i = 0; $i < $num; ++$i ) {
|
||||
$item = new \Item();
|
||||
$item->uri = $link.substr($element->find('a', $i)->href, 20);
|
||||
$item->title = substr($element->find('b', $i)->plaintext, 22);
|
||||
$item->content = preg_replace('#http://cryptome.org/#', $link, $element->find('b', $i)->innertext);
|
||||
$item = array();
|
||||
$item['uri'] = $link.substr($element->find('a', $i)->href, 20);
|
||||
$item['title'] = substr($element->find('b', $i)->plaintext, 22);
|
||||
$item['content'] = preg_replace('#http://cryptome.org/#', $link, $element->find('b', $i)->innertext);
|
||||
$this->items[] = $item;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -63,13 +63,13 @@ class DailymotionBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('div.media a.preview_link') as $element) {
|
||||
if($count < $limit) {
|
||||
$item = new \Item();
|
||||
$item->id = str_replace('/video/', '', strtok($element->href, '_'));
|
||||
$metadata = $this->getMetadata($item->id);
|
||||
$item->uri = $metadata['uri'];
|
||||
$item->title = $metadata['title'];
|
||||
$item->timestamp = $metadata['timestamp'];
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $metadata['thumbnailUri'] . '" /></a><br><a href="' . $item->uri . '">' . $item->title . '</a>';
|
||||
$item = array();
|
||||
$item['id'] = str_replace('/video/', '', strtok($element->href, '_'));
|
||||
$metadata = $this->getMetadata($item['id']);
|
||||
$item['uri'] = $metadata['uri'];
|
||||
$item['title'] = $metadata['title'];
|
||||
$item['timestamp'] = $metadata['timestamp'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $metadata['thumbnailUri'] . '" /></a><br><a href="' . $item['uri'] . '">' . $item['title'] . '</a>';
|
||||
$this->items[] = $item;
|
||||
$count++;
|
||||
}
|
||||
|
|
|
@ -24,14 +24,14 @@ class DanbooruBridge extends BridgeAbstract{
|
|||
}
|
||||
$html = $this->getSimpleHTMLDOM("http://donmai.us/posts?&page=$page&tags=$tags") or $this->returnServerError('Could not request Danbooru.');
|
||||
foreach($html->find('div[id=posts] article') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://donmai.us'.$element->find('a', 0)->href;
|
||||
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-id'));
|
||||
$item->timestamp = time();
|
||||
$item = array();
|
||||
$item['uri'] = 'http://donmai.us'.$element->find('a', 0)->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-id'));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = 'http://donmai.us'.$element->find('img', 0)->src;
|
||||
$item->tags = $element->find('img', 0)->getAttribute('alt');
|
||||
$item->title = 'Danbooru | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->find('img', 0)->getAttribute('alt');
|
||||
$item['title'] = 'Danbooru | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,10 +17,10 @@ class DansTonChatBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request DansTonChat.');
|
||||
|
||||
foreach($html->find('div.item') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = $element->find('a', 0)->href;
|
||||
$item->title = 'DansTonChat '.$element->find('a', 1)->plaintext;
|
||||
$item->content = $element->find('a', 0)->innertext;
|
||||
$item = array();
|
||||
$item['uri'] = $element->find('a', 0)->href;
|
||||
$item['title'] = 'DansTonChat '.$element->find('a', 1)->plaintext;
|
||||
$item['content'] = $element->find('a', 0)->innertext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,11 +63,11 @@ class DauphineLibereBridge extends BridgeAbstract {
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 10) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('title', 0)->innertext;
|
||||
$item->uri = $element->find('guid', 0)->plaintext;
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->ExtractContent($item->uri, $context);
|
||||
$item = array();
|
||||
$item['title'] = $element->find('title', 0)->innertext;
|
||||
$item['uri'] = $element->find('guid', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->ExtractContent($item['uri'], $context);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -37,12 +37,12 @@ class DemoBridge extends BridgeAbstract{
|
|||
|
||||
public function collectData(array $param){
|
||||
|
||||
$item = new \Item();
|
||||
$item->author = "Me!";
|
||||
$item->title = "Test";
|
||||
$item->content = "Awesome content !";
|
||||
$item->id = "Lalala";
|
||||
$item->uri = "http://test.test/test";
|
||||
$item = array();
|
||||
$item['author'] = "Me!";
|
||||
$item['title'] = "Test";
|
||||
$item['content'] = "Awesome content !";
|
||||
$item['id'] = "Lalala";
|
||||
$item['uri'] = "http://test.test/test";
|
||||
|
||||
$this->items[] = $item;
|
||||
|
||||
|
|
|
@ -46,12 +46,12 @@ class DeveloppezDotComBridge extends BridgeAbstract{
|
|||
|
||||
foreach($rssFeed->find('item') as $element) {
|
||||
if($limit < 10) {
|
||||
$item = new \Item();
|
||||
$item->title = $this->DeveloppezDotComStripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = $this->DeveloppezDotComStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$content = $this->DeveloppezDotComExtractContent($item->uri);
|
||||
$item->content = strlen($content) ? $content : $element->description; //In case of it is a tutorial, we just keep the original description
|
||||
$item = array();
|
||||
$item['title'] = $this->DeveloppezDotComStripCDATA($element->find('title', 0)->innertext);
|
||||
$item['uri'] = $this->DeveloppezDotComStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$content = $this->DeveloppezDotComExtractContent($item['uri']);
|
||||
$item['content'] = strlen($content) ? $content : $element->description; //In case of it is a tutorial, we just keep the original description
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -26,12 +26,12 @@ class DilbertBridge extends BridgeAbstract {
|
|||
$title = 'Dilbert Comic Strip on '.$date;
|
||||
$date = strtotime($date);
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $url;
|
||||
$item->title = $title;
|
||||
$item->author = 'Scott Adams';
|
||||
$item->timestamp = $date;
|
||||
$item->content = '<img src="'.$comic.'" alt="'.$img->alt.'" />';
|
||||
$item = array();
|
||||
$item['uri'] = $url;
|
||||
$item['title'] = $title;
|
||||
$item['author'] = 'Scott Adams';
|
||||
$item['timestamp'] = $date;
|
||||
$item['content'] = '<img src="'.$comic.'" alt="'.$img->alt.'" />';
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,14 @@ class DollbooruBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=shm-image-list] a') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://dollbooru.org'.$element->href;
|
||||
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-post-id'));
|
||||
$item->timestamp = time();
|
||||
$item = array();
|
||||
$item['uri'] = 'http://dollbooru.org'.$element->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-post-id'));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = 'http://dollbooru.org'.$element->find('img', 0)->src;
|
||||
$item->tags = $element->getAttribute('data-tags');
|
||||
$item->title = 'Dollbooru | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->getAttribute('data-tags');
|
||||
$item['title'] = 'Dollbooru | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ class DuckDuckGoBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request DuckDuckGo.');
|
||||
|
||||
foreach($html->find('div.results_links') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = $element->find('a', 0)->href;
|
||||
$item->title = $element->find('a', 1)->innertext;
|
||||
$item->content = $element->find('div.snippet', 0)->plaintext;
|
||||
$item = array();
|
||||
$item['uri'] = $element->find('a', 0)->href;
|
||||
$item['title'] = $element->find('a', 1)->innertext;
|
||||
$item['content'] = $element->find('div.snippet', 0)->plaintext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,13 +58,13 @@ class EZTVBridge extends BridgeAbstract{
|
|||
if ($released->plaintext == '>1 week') continue;
|
||||
|
||||
// Fill item
|
||||
$item = new \Item();
|
||||
$item->uri = 'https://eztv.ch/'.$epinfo->href;
|
||||
$item->id = $item->uri;
|
||||
$item->timestamp = makeTimestamp($released->plaintext);
|
||||
$item->title = $epinfo->plaintext;
|
||||
$item->content = $epinfo->alt;
|
||||
if(!empty($item->title))
|
||||
$item = array();
|
||||
$item['uri'] = 'https://eztv.ch/'.$epinfo->href;
|
||||
$item['id'] = $item['uri'];
|
||||
$item['timestamp'] = makeTimestamp($released->plaintext);
|
||||
$item['title'] = $epinfo->plaintext;
|
||||
$item['content'] = $epinfo->alt;
|
||||
if(isset($item['title']))
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,22 +14,22 @@ class EliteDangerousGalnetBridge extends BridgeAbstract
|
|||
{
|
||||
$html = $this->getSimpleHTMLDOM('https://community.elitedangerous.com/galnet') or $this->returnServerError('Error while downloading the website content');
|
||||
foreach($html->find('div.article') as $element) {
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
|
||||
$uri = $element->find('h3 a', 0)->href;
|
||||
$uri = 'https://community.elitedangerous.com' . $uri;
|
||||
$item->uri = $uri;
|
||||
$item['uri'] = $uri;
|
||||
|
||||
$title = $element->find('h3 a', 0)->plaintext;
|
||||
$item->title = substr($title, 1); //remove the space between icon and title
|
||||
$item['title'] = substr($title, 1); //remove the space between icon and title
|
||||
|
||||
$content = $element->find('p', -1)->innertext;
|
||||
$item->content = $content;
|
||||
$item['content'] = $content;
|
||||
|
||||
$date = $element->find('p.small', 0)->innertext;
|
||||
$article_year = substr($date, -4) - 1286; //Convert E:D date to actual date
|
||||
$date = substr($date, 0, -4) . $article_year;
|
||||
$item->timestamp = strtotime($date);
|
||||
$item['timestamp'] = strtotime($date);
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
|
|
@ -63,12 +63,12 @@ class ElsevierBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$param['j']);
|
||||
|
||||
foreach($html->find('.pod-listing') as $article){
|
||||
$item = new \Item();
|
||||
$item->uri = $article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y';
|
||||
$item->title = $article->find('.pod-listing-header>a',0)->plaintext;
|
||||
$item->author = $this->ExtractArticleName($article);
|
||||
$item->timestamp = $this->ExtractArticleTimestamp($article);
|
||||
$item->content = $this->ExtractArticleContent($article);
|
||||
$item = array();
|
||||
$item['uri'] = $article->find('.pod-listing-header>a',0)->getAttribute('href').'?np=y';
|
||||
$item['title'] = $article->find('.pod-listing-header>a',0)->plaintext;
|
||||
$item['author'] = $this->ExtractArticleName($article);
|
||||
$item['timestamp'] = $this->ExtractArticleTimestamp($article);
|
||||
$item['content'] = $this->ExtractArticleContent($article);
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ class EstCeQuonMetEnProdBridge extends BridgeAbstract {
|
|||
|
||||
$html = $this->getSimpleHTMLDOM($this->getURI()) or $this->returnServerError('Could not request EstCeQuonMetEnProd: '.$this->getURI());
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $this->getURI().'#'.date('Y-m-d');
|
||||
$item->title = $this->getName();
|
||||
$item->author = 'Nicolas Hoffmann';
|
||||
$item->timestamp = strtotime('today midnight');
|
||||
$item->content = str_replace('src="/', 'src="'.$this->getURI(), trim(ExtractFromDelimiters($html->outertext, '<body role="document">', '<br /><br />')));
|
||||
$item = array();
|
||||
$item['uri'] = $this->getURI().'#'.date('Y-m-d');
|
||||
$item['title'] = $this->getName();
|
||||
$item['author'] = 'Nicolas Hoffmann';
|
||||
$item['timestamp'] = strtotime('today midnight');
|
||||
$item['content'] = str_replace('src="/', 'src="'.$this->getURI(), trim(ExtractFromDelimiters($html->outertext, '<body role="document">', '<br /><br />')));
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ class FacebookBridge extends BridgeAbstract{
|
|||
|
||||
foreach($element->children() as $post) {
|
||||
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
if (count($post->find('abbr')) > 0) {
|
||||
|
||||
|
@ -195,11 +195,11 @@ class FacebookBridge extends BridgeAbstract{
|
|||
$title = substr($title, 0, strpos(wordwrap($title, 64), "\n")).'...';
|
||||
|
||||
//Build and add final item
|
||||
$item->uri = 'https://facebook.com'.$post->find('abbr')[0]->parent()->getAttribute('href');
|
||||
$item->content = $content;
|
||||
$item->title = $title;
|
||||
$item->author = $author;
|
||||
$item->timestamp = $date;
|
||||
$item['uri'] = 'https://facebook.com'.$post->find('abbr')[0]->parent()->getAttribute('href');
|
||||
$item['content'] = $content;
|
||||
$item['title'] = $title;
|
||||
$item['author'] = $author;
|
||||
$item['timestamp'] = $date;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,12 +16,12 @@ Class FierPandaBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request Fier Panda.');
|
||||
|
||||
foreach($html->find('div.container-content article') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = $this->getURI().$element->find('a', 0)->href;
|
||||
$item->title = trim($element->find('h2 a', 0)->innertext);
|
||||
$item = array();
|
||||
$item['uri'] = $this->getURI().$element->find('a', 0)->href;
|
||||
$item['title'] = trim($element->find('h2 a', 0)->innertext);
|
||||
// Remove the link at the end of the article
|
||||
$element->find('p a', 0)->outertext = '';
|
||||
$item->content = $element->find('p', 0)->innertext;
|
||||
$item['content'] = $element->find('p', 0)->innertext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,10 +27,10 @@ class FlickrExploreBridge extends BridgeAbstract{
|
|||
// Get the image JSON via Flickr API
|
||||
$imageJSON = json_decode(file_get_contents('https://api.flickr.com/services/rest/?method=flickr.photos.getInfo&api_key=103b574d49bd51f0e18bfe907da44a0f&photo_id='.$imageID.'&format=json&nojsoncallback=1')) or $this->returnServerError('Could not request Flickr.'); // FIXME: Request time too long...
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = 'https://flickr.com/photo.gne?id='.$imageID;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $imageURI . '" /></a>'; // FIXME: Filter javascript ?
|
||||
$item->title = $imageJSON->photo->title->_content;
|
||||
$item = array();
|
||||
$item['uri'] = 'https://flickr.com/photo.gne?id='.$imageID;
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $imageURI . '" /></a>'; // FIXME: Filter javascript ?
|
||||
$item['title'] = $imageJSON->photo->title->_content;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,11 +33,11 @@ class FlickrTagBridge extends BridgeAbstract{
|
|||
}
|
||||
|
||||
foreach($html->find('span.photo_container') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://flickr.com'.$element->find('a',0)->href;
|
||||
$item = array();
|
||||
$item['uri'] = 'http://flickr.com'.$element->find('a',0)->href;
|
||||
$thumbnailUri = $element->find('img',0)->getAttribute('data-defer-src');
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a>'; // FIXME: Filter javascript ?
|
||||
$item->title = $element->find('a',0)->title;
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a>'; // FIXME: Filter javascript ?
|
||||
$item['title'] = $element->find('a',0)->title;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ class FootitoBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM('http://www.footito.fr/') or $this->returnServerError('Could not request Footito.');
|
||||
|
||||
foreach($html->find('div.post') as $element) {
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
|
||||
$content = trim($element->innertext);
|
||||
$content = str_replace("<img", "<img style='float : left;'", $content );
|
||||
|
@ -27,15 +27,15 @@ class FootitoBridge extends BridgeAbstract{
|
|||
$content = str_replace("class=\"reaction clearfix\"", "style='margin : 10px 0px; padding : 5px; border-bottom : 1px #DDD solid;'", $content );
|
||||
$content = str_replace("class=\"infos\"", "style='font-size : 0.7em;'", $content );
|
||||
|
||||
$item->content = $content;
|
||||
$item['content'] = $content;
|
||||
|
||||
$title = $element->find('.contenu .texte ', 0)->plaintext;
|
||||
$item->title = $title;
|
||||
$item['title'] = $title;
|
||||
|
||||
$info = $element->find('div.infos', 0);
|
||||
|
||||
$item->timestamp = strtotime($info->find('time', 0)->datetime);
|
||||
$item->author = $info->find('a.auteur', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($info->find('time', 0)->datetime);
|
||||
$item['author'] = $info->find('a.auteur', 0)->plaintext;
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
|
|
@ -30,26 +30,26 @@ class FourchanBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM($url) or $this->returnServerError("Could not request 4chan, thread not found");
|
||||
|
||||
foreach($html->find('div.postContainer') as $element) {
|
||||
$item = new \Item();
|
||||
$item->id = $element->find('.post', 0)->getAttribute('id');
|
||||
$item->uri = $url.'#'.$item->id;
|
||||
$item->timestamp = $element->find('span.dateTime', 0)->getAttribute('data-utc');
|
||||
$item->author = $element->find('span.name', 0)->plaintext;
|
||||
$item = array();
|
||||
$item['id'] = $element->find('.post', 0)->getAttribute('id');
|
||||
$item['uri'] = $url.'#'.$item['id'];
|
||||
$item['timestamp'] = $element->find('span.dateTime', 0)->getAttribute('data-utc');
|
||||
$item['author'] = $element->find('span.name', 0)->plaintext;
|
||||
|
||||
|
||||
if(!empty($element->find('.file', 0) ) ) {
|
||||
$item->image = $element->find('.file a', 0)->href;
|
||||
$item->imageThumb = $element->find('.file img', 0)->src;
|
||||
if(empty($item->imageThumb) and strpos($item->image, '.swf') !== FALSE)
|
||||
$item->imageThumb = 'http://i.imgur.com/eO0cxf9.jpg';
|
||||
$item['image'] = $element->find('.file a', 0)->href;
|
||||
$item['imageThumb'] = $element->find('.file img', 0)->src;
|
||||
if(!isset($item['imageThumb']) and strpos($item['image'], '.swf') !== FALSE)
|
||||
$item['imageThumb'] = 'http://i.imgur.com/eO0cxf9.jpg';
|
||||
}
|
||||
if(!empty($element->find('span.subject', 0)->innertext )) {
|
||||
$item->subject = $element->find('span.subject', 0)->innertext;
|
||||
$item['subject'] = $element->find('span.subject', 0)->innertext;
|
||||
}
|
||||
$item->title = (!empty($item->subject) ? $item->subject.' - ' : '' ) . 'reply '.$item->id.' | '.$item->author;
|
||||
$item['title'] = (isset($item['subject']) ? $item['subject'].' - ' : '' ) . 'reply '.$item['id'].' | '.$item['author'];
|
||||
|
||||
|
||||
$item->content = (!empty($item->image) ? '<a href="'.$item->image.'"><img alt="'.$item->id.'" src="'.$item->imageThumb.'" /></a><br>' : '') . '<span id="'.$item->id.'">'.$element->find('.postMessage', 0)->innertext.'</span>';
|
||||
$item['content'] = (isset($item['image']) ? '<a href="'.$item['image'].'"><img alt="'.$item['id'].'" src="'.$item['imageThumb'].'" /></a><br>' : '') . '<span id="'.$item['id'].'">'.$element->find('.postMessage', 0)->innertext.'</span>';
|
||||
$this->items[] = $item;
|
||||
}
|
||||
$this->items = array_reverse($this->items);
|
||||
|
|
|
@ -19,23 +19,23 @@ class Freenews extends RssExpander {
|
|||
}
|
||||
|
||||
protected function parseRSSItem($newsItem) {
|
||||
$item = new Item();
|
||||
$item->title = trim($newsItem->title);
|
||||
// $this->message("item has for title \"".$item->title."\"");
|
||||
$item = array();
|
||||
$item['title'] = trim($newsItem->title);
|
||||
// $this->message("item has for title \"".$item['title']."\"");
|
||||
if(empty($newsItem->guid)) {
|
||||
$item->uri = (string) $newsItem->link;
|
||||
$item['uri'] = (string) $newsItem->link;
|
||||
} else {
|
||||
$item->uri = (string) $newsItem->guid;
|
||||
$item['uri'] = (string) $newsItem->guid;
|
||||
}
|
||||
// now load that uri from cache
|
||||
// $this->message("now loading page ".$item->uri);
|
||||
$articlePage = str_get_html($this->get_cached($item->uri));
|
||||
// $this->message("now loading page ".$item['uri']);
|
||||
$articlePage = str_get_html($this->get_cached($item['uri']));
|
||||
|
||||
$content = $articlePage->find('.post-container', 0);
|
||||
$item->content = $content->innertext;
|
||||
$item->author = $articlePage->find('a[rel=author]', 0)->innertext;
|
||||
$item['content'] = $content->innertext;
|
||||
$item['author'] = $articlePage->find('a[rel=author]', 0)->innertext;
|
||||
// format should parse 2014-03-25T16:21:20Z. But, according to http://stackoverflow.com/a/10478469, it is not that simple
|
||||
$item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
|
||||
$item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem);
|
||||
return $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -177,12 +177,12 @@ class FuturaSciencesBridge extends BridgeAbstract {
|
|||
$contents = StripWithDelimiters($contents, 'fs:xt:clicktype="', '"');
|
||||
$contents = StripWithDelimiters($contents, 'fs:xt:clickname="', '"');
|
||||
|
||||
$item = new \Item();
|
||||
$item->author = ExtractAuthor($article, $element);
|
||||
$item->uri = $article_url;
|
||||
$item->title = StripCDATA($element->find('title', 0)->innertext);
|
||||
$item->timestamp = strtotime(StripCDATA($element->find('pubDate', 0)->plaintext));
|
||||
$item->content = trim($contents);
|
||||
$item = array();
|
||||
$item['author'] = ExtractAuthor($article, $element);
|
||||
$item['uri'] = $article_url;
|
||||
$item['title'] = StripCDATA($element->find('title', 0)->innertext);
|
||||
$item['timestamp'] = strtotime(StripCDATA($element->find('pubDate', 0)->plaintext));
|
||||
$item['content'] = trim($contents);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -41,12 +41,12 @@ class GBAtempBridge extends BridgeAbstract {
|
|||
}
|
||||
|
||||
private function build_item($uri, $title, $author, $timestamp, $content) {
|
||||
$item = new \Item();
|
||||
$item->uri = $uri;
|
||||
$item->title = $title;
|
||||
$item->author = $author;
|
||||
$item->timestamp = $timestamp;
|
||||
$item->content = $content;
|
||||
$item = array();
|
||||
$item['uri'] = $uri;
|
||||
$item['title'] = $title;
|
||||
$item['author'] = $author;
|
||||
$item['timestamp'] = $timestamp;
|
||||
$item['content'] = $content;
|
||||
return $item;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,35 +33,35 @@ class Gawker extends RssExpander{
|
|||
}
|
||||
|
||||
protected function parseRSSItem($newsItem) {
|
||||
$item = new Item();
|
||||
$item->uri = trim($newsItem->link);
|
||||
$item->title = trim($newsItem->title);
|
||||
$item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
|
||||
$item = array();
|
||||
$item['uri'] = trim($newsItem->link);
|
||||
$item['title'] = trim($newsItem->title);
|
||||
$item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem);
|
||||
// $this->message("///////////////////////////////////////////////////////////////////////////////////////\nprocessing item ".var_export($item, true)."\n\n\nbuilt from\n\n\n".var_export($newsItem, true));
|
||||
try {
|
||||
// now load that uri from cache
|
||||
// $this->message("loading page ".$item->uri);
|
||||
$articlePage = str_get_html($this->get_cached($item->uri));
|
||||
// $this->message("loading page ".$item['uri']);
|
||||
$articlePage = str_get_html($this->get_cached($item['uri']));
|
||||
if(is_object($articlePage)) {
|
||||
$content = $articlePage->find('.post-content', 0);
|
||||
HTMLSanitizer::defaultImageSrcTo($content, $this->getURI());
|
||||
$vcard = $articlePage->find('.vcard', 0);
|
||||
if(is_object($vcard)) {
|
||||
$authorLink = $vcard->find('a', 0);
|
||||
$item->author = $authorLink->innertext;
|
||||
$item['author'] = $authorLink->innertext;
|
||||
// TODO use author link href to fill the feed info
|
||||
}
|
||||
// $this->message("item quite loaded : ".var_export($item, true));
|
||||
// I set item content as last element, for easier var_export reading
|
||||
$item->content = $content->innertext;
|
||||
$item['content'] = $content->innertext;
|
||||
} else {
|
||||
throw new Exception("cache content for ".$item->uri." is NOT a Simple DOM parser object !");
|
||||
throw new Exception("cache content for ".$item['uri']." is NOT a Simple DOM parser object !");
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
$this->message("obtaining ".$item->uri." resulted in exception ".$e->getMessage().". Deleting cached page ...");
|
||||
$this->message("obtaining ".$item['uri']." resulted in exception ".$e->getMessage().". Deleting cached page ...");
|
||||
// maybe file is incorrect. it should be discarded from cache
|
||||
$this->remove_from_cache($item->url);
|
||||
$item->content = $e->getMessage();
|
||||
$this->remove_from_cache($item['url']);
|
||||
$item['content'] = $e->getMessage();
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
|
|
@ -32,14 +32,14 @@ class GelbooruBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=content] span') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://gelbooru.com/'.$element->find('a', 0)->href;
|
||||
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item->timestamp = time();
|
||||
$item = array();
|
||||
$item['uri'] = 'http://gelbooru.com/'.$element->find('a', 0)->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = $element->find('img', 0)->src;
|
||||
$item->tags = $element->find('img', 0)->getAttribute('alt');
|
||||
$item->title = 'Gelbooru | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->find('img', 0)->getAttribute('alt');
|
||||
$item['title'] = 'Gelbooru | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,10 +49,10 @@ class GiphyBridge extends BridgeAbstract{
|
|||
$img = $figure->firstChild();
|
||||
$caption = $figure->lastChild();
|
||||
|
||||
$item = new \Item();
|
||||
$item->id = $img->getAttribute('data-gif_id');
|
||||
$item->uri = $img->getAttribute('data-bitly_gif_url');
|
||||
$item->username = 'Giphy - '.ucfirst($kw);
|
||||
$item = array();
|
||||
$item['id'] = $img->getAttribute('data-gif_id');
|
||||
$item['uri'] = $img->getAttribute('data-bitly_gif_url');
|
||||
$item['username'] = 'Giphy - '.ucfirst($kw);
|
||||
$title = $caption->innertext();
|
||||
$title = preg_replace('/\s+/', ' ',$title);
|
||||
$title = str_replace('animated GIF', '', $title);
|
||||
|
@ -60,11 +60,11 @@ class GiphyBridge extends BridgeAbstract{
|
|||
$title = preg_replace('/\s+/', ' ',$title);
|
||||
$title = trim($title);
|
||||
if (strlen($title) <= 0) {
|
||||
$title = $item->id;
|
||||
$title = $item['id'];
|
||||
}
|
||||
$item->title = trim($title);
|
||||
$item->content =
|
||||
'<a href="'.$item->uri.'">'
|
||||
$item['title'] = trim($title);
|
||||
$item['content'] =
|
||||
'<a href="'.$item['uri'].'">'
|
||||
.'<img src="'.$img->getAttribute('src').'" width="'.$img->getAttribute('data-original-width').'" height="'.$img->getAttribute('data-original-height').'" />'
|
||||
.'</a>';
|
||||
|
||||
|
|
|
@ -37,15 +37,15 @@ class GithubIssueBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('.js-comment-container') as $comment){
|
||||
|
||||
$item = new \Item();
|
||||
$item->author=$comment->find('img',0)->getAttribute('alt');
|
||||
$item = array();
|
||||
$item['author']=$comment->find('img',0)->getAttribute('alt');
|
||||
|
||||
$comment=$comment->firstChild()->nextSibling();
|
||||
|
||||
$item->uri=$uri.'#'.$comment->getAttribute('id');
|
||||
$item->title=trim($comment->firstChild()->plaintext);
|
||||
$item->timestamp=strtotime($comment->find('relative-time',0)->getAttribute('datetime'));
|
||||
$item->content=$comment->find('.comment-body',0)->innertext;
|
||||
$item['uri']=$uri.'#'.$comment->getAttribute('id');
|
||||
$item['title']=trim($comment->firstChild()->plaintext);
|
||||
$item['timestamp']=strtotime($comment->find('relative-time',0)->getAttribute('datetime'));
|
||||
$item['content']=$comment->find('.comment-body',0)->innertext;
|
||||
|
||||
$this->items[]=$item;
|
||||
}
|
||||
|
|
|
@ -47,31 +47,31 @@ class GitlabCommitsBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('li.commit') as $commit){
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri=$param['uri'];
|
||||
$item = array();
|
||||
$item['uri']=$param['uri'];
|
||||
|
||||
foreach($commit->getElementsByTagName('a') as $a){
|
||||
$classes=explode(' ',$a->getAttribute("class"));
|
||||
if(in_array('commit-short-id',$classes) ||
|
||||
in_array('commit_short_id',$classes)){
|
||||
$href=$a->getAttribute('href');
|
||||
$item->uri.=substr($href,strpos($href,'/'.$param['u'].'/'.$param['p']));
|
||||
$item['uri'].=substr($href,strpos($href,'/'.$param['u'].'/'.$param['p']));
|
||||
}
|
||||
if(in_array('commit-row-message',$classes)){
|
||||
$item->title=$a->plaintext;
|
||||
$item['title']=$a->plaintext;
|
||||
}
|
||||
if(in_array('commit-author-link',$classes)){
|
||||
$item->author=trim($a->plaintext);
|
||||
$item['author']=trim($a->plaintext);
|
||||
}
|
||||
}
|
||||
|
||||
$pre=$commit->find('pre',0);
|
||||
if($pre){
|
||||
$item->content=$pre->outertext;
|
||||
$item['content']=$pre->outertext;
|
||||
}else{
|
||||
$item->content='';
|
||||
$item['content']='';
|
||||
}
|
||||
$item->timestamp=strtotime($commit->find('time',0)->getAttribute('datetime'));
|
||||
$item['timestamp']=strtotime($commit->find('time',0)->getAttribute('datetime'));
|
||||
|
||||
$this->items[]=$item;
|
||||
}
|
||||
|
|
|
@ -30,11 +30,11 @@ class GizmodoFRBridge extends BridgeAbstract{
|
|||
|
||||
foreach($rssFeed->find('item') as $element) {
|
||||
if($limit < 15) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('title', 0)->innertext;
|
||||
$item->uri = $element->find('guid', 0)->plaintext;
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = GizmodoFRExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $element->find('title', 0)->innertext;
|
||||
$item['uri'] = $element->find('guid', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = GizmodoFRExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -42,23 +42,23 @@ class GooglePlusPostBridge extends BridgeAbstract
|
|||
|
||||
// foreach ($html->find('meta') as $e)
|
||||
// {
|
||||
// $item = new \Item();
|
||||
// $item->content = var_export($e->attr, true);
|
||||
// $item = array();
|
||||
// $item['content'] = var_export($e->attr, true);
|
||||
// $this->items[] = $item;
|
||||
// }
|
||||
|
||||
// div[jsmodel=XNmfOc]
|
||||
foreach($html->find('div.yt') as $post)
|
||||
{
|
||||
$item = new \Item();
|
||||
// $item->content = $post->find('div.Al', 0)->innertext;
|
||||
$item->username = $item->fullname = $post->find('header.lea h3 a', 0)->innertext;
|
||||
$item->id = $post->getAttribute('id');
|
||||
// $item->title = $item->fullname = $post->find('header.lea', 0)->plaintext;
|
||||
$item->avatar = $post->find('div.ys img', 0)->src;
|
||||
$item = array();
|
||||
// $item['content'] = $post->find('div.Al', 0)->innertext;
|
||||
$item['username'] = $item['fullname'] = $post->find('header.lea h3 a', 0)->innertext;
|
||||
$item['id'] = $post->getAttribute('id');
|
||||
// $item['title'] = $item['fullname'] = $post->find('header.lea', 0)->plaintext;
|
||||
$item['avatar'] = $post->find('div.ys img', 0)->src;
|
||||
// var_dump((($post->find('a.o-U-s', 0)->getAllAttributes())));
|
||||
$item->uri = self::GOOGLE_PLUS_BASE_URL . $post->find('a.o-U-s', 0)->href;
|
||||
$item->timestamp = strtotime($post->find('a.o-U-s', 0)->plaintext);
|
||||
$item['uri'] = self::GOOGLE_PLUS_BASE_URL . $post->find('a.o-U-s', 0)->href;
|
||||
$item['timestamp'] = strtotime($post->find('a.o-U-s', 0)->plaintext);
|
||||
$this->items[] = $item;
|
||||
|
||||
// hashtag to treat : https://plus.google.com/explore/tag
|
||||
|
@ -68,11 +68,11 @@ class GooglePlusPostBridge extends BridgeAbstract
|
|||
$hashtags[ trim($hashtag->plaintext) ] = self::GOOGLE_PLUS_BASE_URL . $hashtag->href;
|
||||
}
|
||||
|
||||
$item->content = '';
|
||||
$item['content'] = '';
|
||||
|
||||
// avatar display
|
||||
$item->content .= '<div style="float:left; margin: 0 0.5em 0.5em 0;"><a href="' . self::GOOGLE_PLUS_BASE_URL . urlencode($this->request);
|
||||
$item->content .= '"><img align="top" alt="avatar" src="' . $item->avatar.'" />' . $item->username . '</a></div>';
|
||||
$item['content'] .= '<div style="float:left; margin: 0 0.5em 0.5em 0;"><a href="' . self::GOOGLE_PLUS_BASE_URL . urlencode($this->request);
|
||||
$item['content'] .= '"><img align="top" alt="avatar" src="' . $item['avatar'].'" />' . $item['username'] . '</a></div>';
|
||||
|
||||
$content = $post->find('div.Al', 0);
|
||||
|
||||
|
@ -100,10 +100,10 @@ class GooglePlusPostBridge extends BridgeAbstract
|
|||
}
|
||||
$content = $content->innertext;
|
||||
|
||||
$item->content .= '<div style="margin-top: -1.5em">' . $content . '</div>';
|
||||
$item['content'] .= '<div style="margin-top: -1.5em">' . $content . '</div>';
|
||||
|
||||
// extract plaintext
|
||||
$item->content_simple = $post->find('div.Al', 0)->plaintext;
|
||||
$item['content_simple'] = $post->find('div.Al', 0)->plaintext;
|
||||
}
|
||||
|
||||
// $html->save(__DIR__ . '/../posts2.html');
|
||||
|
|
|
@ -39,15 +39,15 @@ class GoogleSearchBridge extends BridgeAbstract{
|
|||
$emIsRes = $html->find('div[id=ires]',0);
|
||||
if( !is_null($emIsRes) ){
|
||||
foreach($emIsRes->find('li[class=g]') as $element) {
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
|
||||
// Extract direct URL from google href (eg. /url?q=...)
|
||||
$t = $element->find('a[href]',0)->href;
|
||||
$item->uri = ''.$t;
|
||||
$item['uri'] = ''.$t;
|
||||
parse_str(parse_url($t, PHP_URL_QUERY),$parameters);
|
||||
if (isset($parameters['q'])) { $item->uri = $parameters['q']; }
|
||||
$item->title = $element->find('h3',0)->plaintext;
|
||||
$item->content = $element->find('span[class=st]',0)->plaintext;
|
||||
if (isset($parameters['q'])) { $item['uri'] = $parameters['q']; }
|
||||
$item['title'] = $element->find('h3',0)->plaintext;
|
||||
$item['content'] = $element->find('span[class=st]',0)->plaintext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,11 +20,11 @@ class GuruMedBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = $this->GurumedStripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = $this->GurumedStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->GurumedStripCDATA(strip_tags($element->find('description', 0), '<p><a><br>'));
|
||||
$item = array();
|
||||
$item['title'] = $this->GurumedStripCDATA($element->find('title', 0)->innertext);
|
||||
$item['uri'] = $this->GurumedStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->GurumedStripCDATA(strip_tags($element->find('description', 0), '<p><a><br>'));
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -49,12 +49,12 @@ class HDWallpapersBridge extends BridgeAbstract {
|
|||
foreach($html->find('.wallpapers .wall a') as $element) {
|
||||
$thumbnail = $element->find('img', 0);
|
||||
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
// http://www.hdwallpapers.in/download/yosemite_reflections-1680x1050.jpg
|
||||
$item->uri = $baseUri.'/download'.str_replace('wallpapers.html', $this->resolution.'.jpg', $element->href);
|
||||
$item->timestamp = time();
|
||||
$item->title = $element->find('p', 0)->text();
|
||||
$item->content = $item->title.'<br><a href="'.$item->uri.'"><img src="'.$baseUri.$thumbnail->src.'" /></a>';
|
||||
$item['uri'] = $baseUri.'/download'.str_replace('wallpapers.html', $this->resolution.'.jpg', $element->href);
|
||||
$item['timestamp'] = time();
|
||||
$item['title'] = $element->find('p', 0)->text();
|
||||
$item['content'] = $item['title'].'<br><a href="'.$item['uri'].'"><img src="'.$baseUri.$thumbnail->src.'" /></a>';
|
||||
$this->items[] = $item;
|
||||
|
||||
$num++;
|
||||
|
|
|
@ -13,12 +13,12 @@ class HentaiHavenBridge extends BridgeAbstract{
|
|||
public function collectData(array $param){
|
||||
$html = $this->getSimpleHTMLDOM('http://hentaihaven.org/') or $this->returnServerError('Could not request Hentai Haven.');
|
||||
foreach($html->find('div.zoe-grid') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = $element->find('div.brick-content h3 a', 0)->href;
|
||||
$item = array();
|
||||
$item['uri'] = $element->find('div.brick-content h3 a', 0)->href;
|
||||
$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->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="' . $thumbnailUri . '" /></a><br>' . $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent p.description', 0)->innertext;
|
||||
$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['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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@ class IdenticaBridge extends BridgeAbstract{
|
|||
}
|
||||
|
||||
foreach($html->find('li.major') as $dent) {
|
||||
$item = new \Item();
|
||||
$item->uri = html_entity_decode($dent->find('a', 0)->href); // get dent link
|
||||
$item->timestamp = strtotime($dent->find('abbr.easydate', 0)->plaintext); // extract dent timestamp
|
||||
$item->content = trim($dent->find('div.activity-content', 0)->innertext); // extract dent text
|
||||
$item->title = $param['u'] . ' | ' . $item->content;
|
||||
$item = array();
|
||||
$item['uri'] = html_entity_decode($dent->find('a', 0)->href); // get dent link
|
||||
$item['timestamp'] = strtotime($dent->find('abbr.easydate', 0)->plaintext); // extract dent timestamp
|
||||
$item['content'] = trim($dent->find('div.activity-content', 0)->innertext); // extract dent text
|
||||
$item['title'] = $param['u'] . ' | ' . $item['content'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,16 +54,16 @@ class InstagramBridge extends BridgeAbstract{
|
|||
foreach($userMedia as $media)
|
||||
{
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = "https://instagram.com/p/".$media->code."/";
|
||||
$item->content = '<img src="' . htmlentities($media->display_src) . '" />';
|
||||
$item = array();
|
||||
$item['uri'] = "https://instagram.com/p/".$media->code."/";
|
||||
$item['content'] = '<img src="' . htmlentities($media->display_src) . '" />';
|
||||
if (isset($media->caption))
|
||||
{
|
||||
$item->title = $media->caption;
|
||||
$item['title'] = $media->caption;
|
||||
} else {
|
||||
$item->title = basename($media->display_src);
|
||||
$item['title'] = basename($media->display_src);
|
||||
}
|
||||
$item->timestamp = $media->date;
|
||||
$item['timestamp'] = $media->date;
|
||||
$this->items[] = $item;
|
||||
|
||||
}
|
||||
|
|
|
@ -246,13 +246,13 @@ class IsoHuntBridge extends BridgeAbstract{
|
|||
if(!$date)
|
||||
$this->returnServerError('Unable to find date!');
|
||||
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->uri = $this->fix_relative_uri($anchor->href);
|
||||
$item->title = $anchor->title;
|
||||
// $item->author =
|
||||
$item->timestamp = strtotime($date->plaintext);
|
||||
$item->content = $this->fix_relative_uri($torrent->innertext);
|
||||
$item['uri'] = $this->fix_relative_uri($anchor->href);
|
||||
$item['title'] = $anchor->title;
|
||||
// $item['author'] =
|
||||
$item['timestamp'] = strtotime($date->plaintext);
|
||||
$item['content'] = $this->fix_relative_uri($torrent->innertext);
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
@ -284,13 +284,13 @@ class IsoHuntBridge extends BridgeAbstract{
|
|||
if(!$element)
|
||||
$this->returnServerError('Unable to find element!');
|
||||
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->uri = $element->href;
|
||||
$item->title = $element->plaintext;
|
||||
// $item->author =
|
||||
// $item->timestamp =
|
||||
// $item->content =
|
||||
$item['uri'] = $element->href;
|
||||
$item['title'] = $element->plaintext;
|
||||
// $item['author'] =
|
||||
// $item['timestamp'] =
|
||||
// $item['content'] =
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
@ -310,13 +310,13 @@ class IsoHuntBridge extends BridgeAbstract{
|
|||
$this->returnServerError('Unable to find posts!');
|
||||
|
||||
foreach($posts as $post){
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->uri = $this->latest_news_extract_uri($post);
|
||||
$item->title = $this->latest_news_extract_title($post);
|
||||
$item->author = $this->latest_news_extract_author($post);
|
||||
$item->timestamp = $this->latest_news_extract_timestamp($post);
|
||||
$item->content = $this->latest_news_extract_content($post);
|
||||
$item['uri'] = $this->latest_news_extract_uri($post);
|
||||
$item['title'] = $this->latest_news_extract_title($post);
|
||||
$item['author'] = $this->latest_news_extract_author($post);
|
||||
$item['timestamp'] = $this->latest_news_extract_timestamp($post);
|
||||
$item['content'] = $this->latest_news_extract_content($post);
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
@ -399,13 +399,13 @@ class IsoHuntBridge extends BridgeAbstract{
|
|||
$this->returnServerError('Unable to find torrents!');
|
||||
|
||||
foreach($torrents as $torrent){
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->uri = $this->latest_torrents_extract_uri($torrent);
|
||||
$item->title = $this->latest_torrents_extract_title($torrent);
|
||||
$item->author = $this->latest_torrents_extract_author($torrent);
|
||||
$item->timestamp = $this->latest_torrents_extract_timestamp($torrent);
|
||||
$item->content = ''; // There is no valuable content
|
||||
$item['uri'] = $this->latest_torrents_extract_uri($torrent);
|
||||
$item['title'] = $this->latest_torrents_extract_title($torrent);
|
||||
$item['author'] = $this->latest_torrents_extract_author($torrent);
|
||||
$item['timestamp'] = $this->latest_torrents_extract_timestamp($torrent);
|
||||
$item['content'] = ''; // There is no valuable content
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
|
|
@ -82,11 +82,11 @@ class JapanExpoBridge extends BridgeAbstract{
|
|||
$content = '<img src="'.$thumbnail.'"></img><br />'.$date_text.'<br /><a href="'.$url.'">Lire l\'article</a>';
|
||||
}
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $url;
|
||||
$item->title = $title;
|
||||
$item->timestamp = $timestamp;
|
||||
$item->content = $content;
|
||||
$item = array();
|
||||
$item['uri'] = $url;
|
||||
$item['title'] = $title;
|
||||
$item['timestamp'] = $timestamp;
|
||||
$item['content'] = $content;
|
||||
$this->items[] = $item;
|
||||
$count++;
|
||||
}
|
||||
|
|
|
@ -33,13 +33,13 @@ class KonachanBridge extends BridgeAbstract{
|
|||
|
||||
foreach($data as $datai) {
|
||||
$json = json_decode($datai, TRUE);
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://konachan.com/post/show/'.$json['id'];
|
||||
$item->postid = $json['id'];
|
||||
$item->timestamp = $json['created_at'];
|
||||
$item->imageUri = $json['file_url'];
|
||||
$item->title = 'Konachan | '.$json['id'];
|
||||
$item->content = '<a href="' . $item->imageUri . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
|
||||
$item = array();
|
||||
$item['uri'] = 'http://konachan.com/post/show/'.$json['id'];
|
||||
$item['postid'] = $json['id'];
|
||||
$item['timestamp'] = $json['created_at'];
|
||||
$item['imageUri'] = $json['file_url'];
|
||||
$item['title'] = 'Konachan | '.$json['id'];
|
||||
$item['content'] = '<a href="' . $item['imageUri'] . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@ class KoreusBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = $this->KoreusStripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = $this->KoreusStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->KoreusExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $this->KoreusStripCDATA($element->find('title', 0)->innertext);
|
||||
$item['uri'] = $this->KoreusStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->KoreusExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -93,17 +93,17 @@ class KununuBridge extends BridgeAbstract{
|
|||
|
||||
// Go through all articles
|
||||
foreach($articles as $article){
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->author = $this->extract_article_author_position($article);
|
||||
$item->timestamp = $this->extract_article_date($article);
|
||||
$item->title = $this->extract_article_rating($article) . ' : ' . $this->extract_article_summary($article);
|
||||
$item->uri = $this->extract_article_uri($article);
|
||||
$item['author'] = $this->extract_article_author_position($article);
|
||||
$item['timestamp'] = $this->extract_article_date($article);
|
||||
$item['title'] = $this->extract_article_rating($article) . ' : ' . $this->extract_article_summary($article);
|
||||
$item['uri'] = $this->extract_article_uri($article);
|
||||
|
||||
if($full)
|
||||
$item->content = $this->extract_full_description($item->uri);
|
||||
$item['content'] = $this->extract_full_description($item['uri']);
|
||||
else
|
||||
$item->content = $this->extract_article_description($article);
|
||||
$item['content'] = $this->extract_article_description($article);
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
|
|
@ -81,34 +81,34 @@ class LWNprevBridge extends BridgeAbstract{
|
|||
continue;
|
||||
}
|
||||
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$h2NextSibling=$h2->nextSibling;
|
||||
$this->jumpToNextTag($h2NextSibling);
|
||||
|
||||
switch($h2NextSibling->getAttribute('class')){
|
||||
case 'FeatureByline':
|
||||
$item->author=$h2NextSibling->getElementsByTagName('b')->item(0)->textContent;
|
||||
$item['author']=$h2NextSibling->getElementsByTagName('b')->item(0)->textContent;
|
||||
break;
|
||||
case 'GAByline':
|
||||
$text=$h2NextSibling->textContent;
|
||||
$item->author=substr($text,strpos($text,'by '));
|
||||
$item['author']=substr($text,strpos($text,'by '));
|
||||
break;
|
||||
default:
|
||||
$item->author='LWN';
|
||||
$item['author']='LWN';
|
||||
break;
|
||||
};
|
||||
|
||||
$h2FirstChild=$h2->firstChild;
|
||||
$this->jumpToNextTag($h2FirstChild);
|
||||
if($h2FirstChild->nodeName==='a'){
|
||||
$item->uri='https://lwn.net'.$h2FirstChild->getAttribute('href');
|
||||
$item['uri']='https://lwn.net'.$h2FirstChild->getAttribute('href');
|
||||
}else{
|
||||
$item->uri=$realURI.'#'.$URICounter;
|
||||
$item['uri']=$realURI.'#'.$URICounter;
|
||||
}
|
||||
$URICounter++;
|
||||
|
||||
$item->timestamp=$editionTimeStamp+$URICounter;
|
||||
$item['timestamp']=$editionTimeStamp+$URICounter;
|
||||
|
||||
$h2PrevSibling=$h2->previousSibling;
|
||||
$this->jumpToPreviousTag($h2PrevSibling);
|
||||
|
@ -131,11 +131,11 @@ class LWNprevBridge extends BridgeAbstract{
|
|||
}
|
||||
$h2PrevSibling=null;
|
||||
|
||||
$item->title='';
|
||||
$item['title']='';
|
||||
if(!empty($cat1)){
|
||||
$item->title.='['.$cat1.($cat2?'/'.$cat2:'').'] ';
|
||||
$item['title'].='['.$cat1.($cat2?'/'.$cat2:'').'] ';
|
||||
}
|
||||
$item->title.=$h2->textContent;
|
||||
$item['title'].=$h2->textContent;
|
||||
|
||||
$node=$h2;
|
||||
$content='';
|
||||
|
@ -156,7 +156,7 @@ class LWNprevBridge extends BridgeAbstract{
|
|||
$content.=$node->C14N();
|
||||
}
|
||||
}
|
||||
$item->content=$content;
|
||||
$item['content']=$content;
|
||||
$this->items[]=$item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,8 +160,8 @@ class LeBonCoinBridge extends BridgeAbstract{
|
|||
|
||||
$element = $element->find('a', 0);
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $element->href;
|
||||
$item = array();
|
||||
$item['uri'] = $element->href;
|
||||
$title = html_entity_decode($element->getAttribute('title'));
|
||||
$content_image = $element->find('div.item_image', 0)->find('.lazyload', 0);
|
||||
|
||||
|
@ -178,8 +178,8 @@ class LeBonCoinBridge extends BridgeAbstract{
|
|||
$price = $detailsList->find('h3.item_price', 0);
|
||||
$content .= $price === NULL ? '' : $price->plaintext;
|
||||
|
||||
$item->title = $title;
|
||||
$item->content = $content . $date;
|
||||
$item['title'] = $title;
|
||||
$item['content'] = $content . $date;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,11 +42,11 @@ class LeJournalDuGeekBridge extends BridgeAbstract{
|
|||
|
||||
foreach($rssFeed->find('item') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = $this->LeJournalDuGeekStripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = $this->LeJournalDuGeekStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->LeJournalDuGeekExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $this->LeJournalDuGeekStripCDATA($element->find('title', 0)->innertext);
|
||||
$item['uri'] = $this->LeJournalDuGeekStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->LeJournalDuGeekExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -48,12 +48,12 @@ class LeMondeInformatiqueBridge extends BridgeAbstract {
|
|||
$article_title = $article_html->find('h1.cleanprint-title', 0)->plaintext;
|
||||
|
||||
//Build and add final item
|
||||
$item = new \Item();
|
||||
$item->uri = $article_uri;
|
||||
$item->title = $article_title;
|
||||
$item->author = StripCDATA($element->find('dc:creator', 0)->innertext);
|
||||
$item->timestamp = strtotime($element->find('dc:date', 0)->plaintext);
|
||||
$item->content = $article_content;
|
||||
$item = array();
|
||||
$item['uri'] = $article_uri;
|
||||
$item['title'] = $article_title;
|
||||
$item['author'] = StripCDATA($element->find('dc:creator', 0)->innertext);
|
||||
$item['timestamp'] = strtotime($element->find('dc:date', 0)->plaintext);
|
||||
$item['content'] = $article_content;
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -19,22 +19,22 @@ class Les400Culs extends RssExpander{
|
|||
}
|
||||
|
||||
protected function parseRSSItem($newsItem) {
|
||||
$item = new Item();
|
||||
$item->title = trim((string) $newsItem->title);
|
||||
$item = array();
|
||||
$item['title'] = trim((string) $newsItem->title);
|
||||
// $this->message("browsing item ".var_export($newsItem, true));
|
||||
if(empty($newsItem->guid)) {
|
||||
$item->uri = (string) $newsItem->link;
|
||||
$item['uri'] = (string) $newsItem->link;
|
||||
} else {
|
||||
$item->uri = (string) $newsItem->guid;
|
||||
$item['uri'] = (string) $newsItem->guid;
|
||||
}
|
||||
// now load that uri from cache
|
||||
// $this->message("now loading page ".$item->uri);
|
||||
// $articlePage = str_get_html($this->get_cached($item->uri));
|
||||
// $this->message("now loading page ".$item['uri']);
|
||||
// $articlePage = str_get_html($this->get_cached($item['uri']));
|
||||
|
||||
// $content = $articlePage->find('.post-container', 0);
|
||||
$item->content = (string) $newsItem->description;
|
||||
$item->author = (string) $newsItem->author;
|
||||
$item->timestamp = $this->RSS_2_0_time_to_timestamp($newsItem);
|
||||
$item['content'] = (string) $newsItem->description;
|
||||
$item['author'] = (string) $newsItem->author;
|
||||
$item['timestamp'] = $this->RSS_2_0_time_to_timestamp($newsItem);
|
||||
return $item;
|
||||
}
|
||||
public function getCacheDuration(){
|
||||
|
|
|
@ -14,7 +14,7 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM('http://lesjoiesducode.fr/') or $this->returnServerError('Could not request LesJoiesDuCode.');
|
||||
|
||||
foreach($html->find('div.blog-post') as $element) {
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
$temp = $element->find('h1 a', 0);
|
||||
$titre = html_entity_decode($temp->innertext);
|
||||
$url = $temp->href;
|
||||
|
@ -35,13 +35,13 @@ class LesJoiesDuCodeBridge extends BridgeAbstract{
|
|||
if($pos > 0)
|
||||
{
|
||||
$auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2))));
|
||||
$item->author = $auteur;
|
||||
$item['author'] = $auteur;
|
||||
}
|
||||
|
||||
|
||||
$item->content .= trim($content);
|
||||
$item->uri = $url;
|
||||
$item->title = trim($titre);
|
||||
$item['content'] .= trim($content);
|
||||
$item['uri'] = $url;
|
||||
$item['title'] = trim($titre);
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
|
|
@ -19,14 +19,14 @@ class LichessBridge extends BridgeAbstract
|
|||
{
|
||||
if ($posts_loaded < 5)
|
||||
{
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$item->title = html_entity_decode($entry->find('title', 0)->innertext);
|
||||
$item->author = $entry->find('author', 0)->find('name', 0)->innertext;
|
||||
$item->uri = $entry->find('id', 0)->plaintext;
|
||||
$item->timestamp = strtotime($entry->find('published', 0)->plaintext);
|
||||
$item['title'] = html_entity_decode($entry->find('title', 0)->innertext);
|
||||
$item['author'] = $entry->find('author', 0)->find('name', 0)->innertext;
|
||||
$item['uri'] = $entry->find('id', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($entry->find('published', 0)->plaintext);
|
||||
|
||||
$item->content = $this->retrieve_lichess_post($item->uri);
|
||||
$item['content'] = $this->retrieve_lichess_post($item['uri']);
|
||||
|
||||
$this->items[] = $item;
|
||||
$posts_loaded++;
|
||||
|
|
|
@ -25,10 +25,10 @@ class LinkedInCompany extends BridgeAbstract{
|
|||
foreach($html->find('//*[@id="my-feed-post"]/li') as $element) {
|
||||
$title = $element->find('span.share-body', 0)->innertext;
|
||||
if ($title) {
|
||||
$item = new \Item();
|
||||
$item->uri = $link;
|
||||
$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 = array();
|
||||
$item['uri'] = $link;
|
||||
$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);
|
||||
$this->items[] = $item;
|
||||
$i++;
|
||||
}
|
||||
|
|
|
@ -33,13 +33,13 @@ class LolibooruBridge extends BridgeAbstract{
|
|||
|
||||
foreach($data as $datai) {
|
||||
$json = json_decode($datai, TRUE);
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://lolibooru.moe/post/show/'.$json['id'];
|
||||
$item->postid = $json['id'];
|
||||
$item->timestamp = $json['created_at'];
|
||||
$item->imageUri = $json['file_url'];
|
||||
$item->title = 'Lolibooru | '.$json['id'];
|
||||
$item->content = '<a href="' . $item->imageUri . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
|
||||
$item = array();
|
||||
$item['uri'] = 'http://lolibooru.moe/post/show/'.$json['id'];
|
||||
$item['postid'] = $json['id'];
|
||||
$item['timestamp'] = $json['created_at'];
|
||||
$item['imageUri'] = $json['file_url'];
|
||||
$item['title'] = 'Lolibooru | '.$json['id'];
|
||||
$item['content'] = '<a href="' . $item['imageUri'] . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -128,18 +128,18 @@ class MangareaderBridge extends BridgeAbstract{
|
|||
$chapters = $xpath->query("a[@class='chaptersrec']", $node);
|
||||
|
||||
if (isset($manga) && $chapters->length >= 1){
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://www.mangareader.net' . htmlspecialchars($manga->getAttribute('href'));
|
||||
$item->title = htmlspecialchars($manga->nodeValue);
|
||||
$item = array();
|
||||
$item['uri'] = 'http://www.mangareader.net' . htmlspecialchars($manga->getAttribute('href'));
|
||||
$item['title'] = htmlspecialchars($manga->nodeValue);
|
||||
|
||||
// Add each chapter to the feed
|
||||
$item->content = "";
|
||||
$item['content'] = "";
|
||||
|
||||
foreach ($chapters as $chapter){
|
||||
if($item->content <> ""){
|
||||
$item->content .= "<br>";
|
||||
if($item['content'] <> ""){
|
||||
$item['content'] .= "<br>";
|
||||
}
|
||||
$item->content .= "<a href='http://www.mangareader.net" . htmlspecialchars($chapter->getAttribute('href')) . "'>" . htmlspecialchars($chapter->nodeValue) . "</a>";
|
||||
$item['content'] .= "<a href='http://www.mangareader.net" . htmlspecialchars($chapter->getAttribute('href')) . "'>" . htmlspecialchars($chapter->nodeValue) . "</a>";
|
||||
}
|
||||
|
||||
$this->items[] = $item;
|
||||
|
@ -162,13 +162,13 @@ class MangareaderBridge extends BridgeAbstract{
|
|||
$mangaimgelement = $xpath->query(".//*[@class='imgsearchresults']", $manga)->item(0)->getAttribute('style');
|
||||
$thumbnail = substr($mangaimgelement, 22, strlen($mangaimgelement) - 24);
|
||||
|
||||
$item = new \Item();
|
||||
$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->author = htmlspecialchars($xpath->query("//*[@class='author_name']", $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->content = '<a href="' . $item->uri . '"><img src="' . $thumbnail . '" alt="' . $item->title . '" /></a><p>' . $item->genre . '</p><p>' . $item->chaptercount . '</p>';
|
||||
$item = array();
|
||||
$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['author'] = htmlspecialchars($xpath->query("//*[@class='author_name']", $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['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnail . '" alt="' . $item['title'] . '" /></a><p>' . $item['genre'] . '</p><p>' . $item['chaptercount'] . '</p>';
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
@ -186,18 +186,18 @@ class MangareaderBridge extends BridgeAbstract{
|
|||
$chapters = $xpath->query($query);
|
||||
|
||||
foreach ($chapters as $chapter){
|
||||
$item = new \Item();
|
||||
$item->title = htmlspecialchars($xpath->query("td[1]", $chapter)->item(0)->nodeValue);
|
||||
$item->uri = 'http://www.mangareader.net' . $xpath->query("td[1]/a", $chapter)->item(0)->getAttribute('href');
|
||||
$item->timestamp = strtotime($xpath->query("td[2]", $chapter)->item(0)->nodeValue);
|
||||
$item = array();
|
||||
$item['title'] = htmlspecialchars($xpath->query("td[1]", $chapter)->item(0)->nodeValue);
|
||||
$item['uri'] = 'http://www.mangareader.net' . $xpath->query("td[1]/a", $chapter)->item(0)->getAttribute('href');
|
||||
$item['timestamp'] = strtotime($xpath->query("td[2]", $chapter)->item(0)->nodeValue);
|
||||
array_unshift($this->items, $item);
|
||||
}
|
||||
}
|
||||
|
||||
// Return some dummy-data if no content available
|
||||
if(count($this->items) == 0){
|
||||
$item = new \Item();
|
||||
$item->content = "<p>No updates available</p>";
|
||||
$item = array();
|
||||
$item['content'] = "<p>No updates available</p>";
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
|
|
@ -29,14 +29,14 @@ class MilbooruBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=shm-image-list] span[class=thumb]') as $element) {
|
||||
$item = new \Item();
|
||||
$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->timestamp = time();
|
||||
$item = array();
|
||||
$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['timestamp'] = time();
|
||||
$thumbnailUri = 'http://sheslostcontrol.net/moe/shimmie/'.$element->find('img', 0)->src;
|
||||
$item->tags = $element->find('a', 0)->getAttribute('data-tags');
|
||||
$item->title = 'Milbooru | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->find('a', 0)->getAttribute('data-tags');
|
||||
$item['title'] = 'Milbooru | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,10 +13,10 @@ class MondeDiploBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('div.unarticle') as $article) {
|
||||
$element = $article->parent();
|
||||
$item = new Item();
|
||||
$item->uri = $this->uri . $element->href;
|
||||
$item->title = $element->find('h3', 0)->plaintext;
|
||||
$item->content = $element->find('div.dates_auteurs', 0)->plaintext . '<br>' . strstr($element->find('div', 0)->plaintext, $element->find('div.dates_auteurs', 0)->plaintext, true);
|
||||
$item = array();
|
||||
$item['uri'] = $this->uri . $element->href;
|
||||
$item['title'] = $element->find('h3', 0)->plaintext;
|
||||
$item['content'] = $element->find('div.dates_auteurs', 0)->plaintext . '<br>' . strstr($element->find('div', 0)->plaintext, $element->find('div.dates_auteurs', 0)->plaintext, true);
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@ class MsnMondeBridge extends BridgeAbstract{
|
|||
|
||||
private function MsnMondeExtractContent($url, &$item) {
|
||||
$html2 = $this->getSimpleHTMLDOM($url);
|
||||
$item->content = $html2->find('#content', 0)->find('article', 0)->find('section', 0)->plaintext;
|
||||
$item->timestamp = strtotime($html2->find('.authorinfo-txt', 0)->find('time', 0)->datetime);
|
||||
$item['content'] = $html2->find('#content', 0)->find('article', 0)->find('section', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($html2->find('.authorinfo-txt', 0)->find('time', 0)->datetime);
|
||||
}
|
||||
|
||||
public function collectData(array $param){
|
||||
|
@ -19,10 +19,10 @@ class MsnMondeBridge extends BridgeAbstract{
|
|||
$limit = 0;
|
||||
foreach($html->find('.smalla') as $article) {
|
||||
if($limit < 10) {
|
||||
$item = new \Item();
|
||||
$item->title = utf8_decode($article->find('h4', 0)->innertext);
|
||||
$item->uri = "http://www.msn.com" . utf8_decode($article->find('a', 0)->href);
|
||||
$this->MsnMondeExtractContent($item->uri, $item);
|
||||
$item = array();
|
||||
$item['title'] = utf8_decode($article->find('h4', 0)->innertext);
|
||||
$item['uri'] = "http://www.msn.com" . utf8_decode($article->find('a', 0)->href);
|
||||
$this->MsnMondeExtractContent($item['uri'], $item);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -32,14 +32,14 @@ class MspabooruBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=content] span') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://mspabooru.com/'.$element->find('a', 0)->href;
|
||||
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item->timestamp = time();
|
||||
$item = array();
|
||||
$item['uri'] = 'http://mspabooru.com/'.$element->find('a', 0)->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = $element->find('img', 0)->src;
|
||||
$item->tags = $element->find('img', 0)->getAttribute('alt');
|
||||
$item->title = 'Mspabooru | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->find('img', 0)->getAttribute('alt');
|
||||
$item['title'] = 'Mspabooru | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,12 +56,12 @@ class NakedSecurityBridge extends BridgeAbstract {
|
|||
$article_content = '<p><img src="'.$article_image.'" /></p><p><b>'.$article_summary.'</b></p>'.$article_content;
|
||||
|
||||
//Build and add final item
|
||||
$item = new \Item();
|
||||
$item->uri = $article_uri;
|
||||
$item->title = $article_title;
|
||||
$item->author = $article_html->find('a[rel=author]', 0)->plaintext;
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $article_content;
|
||||
$item = array();
|
||||
$item['uri'] = $article_uri;
|
||||
$item['title'] = $article_title;
|
||||
$item['author'] = $article_html->find('a[rel=author]', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $article_content;
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ class NasaApodBridge extends BridgeAbstract{
|
|||
for($i = 0; $i < 3;$i++)
|
||||
{
|
||||
$line = $list[$i];
|
||||
$item = new \Item();
|
||||
$item = array();
|
||||
|
||||
$uri_page = $html->find('a',$i + 3)->href;
|
||||
$uri = 'http://apod.nasa.gov/apod/'.$uri_page;
|
||||
$item->uri = $uri;
|
||||
$item['uri'] = $uri;
|
||||
|
||||
$picture_html = $this->getSimpleHTMLDOM($uri);
|
||||
$picture_html_string = $picture_html->innertext;
|
||||
|
@ -35,11 +35,11 @@ class NasaApodBridge extends BridgeAbstract{
|
|||
|
||||
//Extract date from the picture page
|
||||
$date = explode(" ", $picture_html->find('p',1)->innertext);
|
||||
$item->timestamp = strtotime($date[4].$date[3].$date[2]);
|
||||
$item['timestamp'] = strtotime($date[4].$date[3].$date[2]);
|
||||
|
||||
//Other informations
|
||||
$item->content = $media.'<br />'.$explanation;
|
||||
$item->title = $picture_html->find('b',0)->innertext;
|
||||
$item['content'] = $media.'<br />'.$explanation;
|
||||
$item['title'] = $picture_html->find('b',0)->innertext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,12 +42,12 @@ class NeuviemeArtBridge extends BridgeAbstract {
|
|||
$article_content = StripWithDelimiters($article_content, '<link', '>');
|
||||
|
||||
//Build and add final item
|
||||
$item = new \Item();
|
||||
$item->uri = $article_uri;
|
||||
$item->title = $article_title;
|
||||
$item->author = $article_html->find('a[class=upp transition_fast upp]', 0)->plaintext;
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $article_content;
|
||||
$item = array();
|
||||
$item['uri'] = $article_uri;
|
||||
$item['title'] = $article_title;
|
||||
$item['author'] = $article_html->find('a[class=upp transition_fast upp]', 0)->plaintext;
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $article_content;
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -31,12 +31,12 @@ class NextInpactBridge extends BridgeAbstract {
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 3) {
|
||||
$item = new \Item();
|
||||
$item->title = $this->StripCDATA($element->find('title', 0)->innertext);
|
||||
$item->uri = $this->StripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->author = $this->StripCDATA($element->find('creator', 0)->innertext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->ExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $this->StripCDATA($element->find('title', 0)->innertext);
|
||||
$item['uri'] = $this->StripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item['author'] = $this->StripCDATA($element->find('creator', 0)->innertext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->ExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -74,12 +74,12 @@ class NextgovBridge extends BridgeAbstract {
|
|||
.'<p><b>'.$article_subtitle.'</b></p>'
|
||||
.trim($contents);
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $article_url;
|
||||
$item->title = $article_title;
|
||||
$item->author = $article_author;
|
||||
$item->timestamp = $article_timestamp;
|
||||
$item->content = $contents;
|
||||
$item = array();
|
||||
$item['uri'] = $article_url;
|
||||
$item['title'] = $article_title;
|
||||
$item['author'] = $article_author;
|
||||
$item['timestamp'] = $article_timestamp;
|
||||
$item['content'] = $contents;
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -34,11 +34,11 @@ class NiceMatinBridge extends BridgeAbstract{
|
|||
$element_text = str_replace('</link>', '</url>', $element_text);
|
||||
$element = str_get_html($element_text);
|
||||
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('title', 0)->innertext;
|
||||
$item->uri = $element->find('url', 0)->innertext;
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item->content = $this->NiceMatinExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $element->find('title', 0)->innertext;
|
||||
$item['uri'] = $element->find('url', 0)->innertext;
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item['content'] = $this->NiceMatinExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -33,12 +33,12 @@ class NovelUpdatesBridge extends BridgeAbstract{
|
|||
$html = stristr($html, '<tr>'); //remove tbody
|
||||
$html = str_get_html(stristr($html, '</tbody>', true)); //remove last tbody and get back as an array
|
||||
foreach($html->find('tr') as $element){
|
||||
$item = new \Item();
|
||||
$item->uri = $element->find('td', 2)->find('a', 0)->href;
|
||||
$item->title = $element->find('td', 2)->find('a', 0)->plaintext;
|
||||
$item->team = $element->find('td', 1)->innertext;
|
||||
$item->timestamp = strtotime($element->find('td', 0)->plaintext);
|
||||
$item->content = '<a href="'.$item->uri.'">'.$this->request.' - '.$item->title.'</a> by '.$item->team.'<br><a href="'.$item->uri.'">'.$fullhtml->find('div.seriesimg', 0)->innertext.'</a>';
|
||||
$item = array();
|
||||
$item['uri'] = $element->find('td', 2)->find('a', 0)->href;
|
||||
$item['title'] = $element->find('td', 2)->find('a', 0)->plaintext;
|
||||
$item['team'] = $element->find('td', 1)->innertext;
|
||||
$item['timestamp'] = strtotime($element->find('td', 0)->plaintext);
|
||||
$item['content'] = '<a href="'.$item['uri'].'">'.$this->request.' - '.$item['title'].'</a> by '.$item['team'].'<br><a href="'.$item['uri'].'">'.$fullhtml->find('div.seriesimg', 0)->innertext.'</a>';
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,11 +24,11 @@ class NumeramaBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = html_entity_decode(NumeramaStripCDATA($element->find('title', 0)->innertext));
|
||||
$item->author = NumeramaStripCDATA($element->find('dc:creator', 0)->innertext);
|
||||
$item->uri = NumeramaStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
$item = array();
|
||||
$item['title'] = html_entity_decode(NumeramaStripCDATA($element->find('title', 0)->innertext));
|
||||
$item['author'] = NumeramaStripCDATA($element->find('dc:creator', 0)->innertext);
|
||||
$item['uri'] = NumeramaStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$item['timestamp'] = strtotime($element->find('pubDate', 0)->plaintext);
|
||||
|
||||
$article_url = NumeramaStripCDATA($element->find('guid', 0)->plaintext);
|
||||
$article_html = $this->getSimpleHTMLDOM($article_url) or $this->returnServerError('Could not request Numerama: '.$article_url);
|
||||
|
@ -36,7 +36,7 @@ class NumeramaBridge extends BridgeAbstract{
|
|||
$contents = '<img alt="" style="max-width:300px;" src="'.$article_html->find('meta[property=og:image]', 0)->getAttribute('content').'">'; // add post picture
|
||||
$contents = $contents.$article_html->find('article[class=post-content]', 0)->innertext; // extract the post
|
||||
|
||||
$item->content = $contents;
|
||||
$item['content'] = $contents;
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -41,10 +41,10 @@ class OpenClassroomsBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request OpenClassrooms.');
|
||||
|
||||
foreach($html->find('.courseListItem') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'https://openclassrooms.com'.$element->find('a', 0)->href;
|
||||
$item->title = $element->find('h3', 0)->plaintext;
|
||||
$item->content = $element->find('slidingItem__descriptionContent', 0)->plaintext;
|
||||
$item = array();
|
||||
$item['uri'] = 'https://openclassrooms.com'.$element->find('a', 0)->href;
|
||||
$item['title'] = $element->find('h3', 0)->plaintext;
|
||||
$item['content'] = $element->find('slidingItem__descriptionContent', 0)->plaintext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,10 +78,10 @@ class ParuVenduImmoBridge extends BridgeAbstract
|
|||
|
||||
list($href) = explode('#', $element->href);
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $this->uri.$href;
|
||||
$item->title = $element->title;
|
||||
$item->content = $img.$desc.$price;
|
||||
$item = array();
|
||||
$item['uri'] = $this->uri.$href;
|
||||
$item['title'] = $element->title;
|
||||
$item['content'] = $img.$desc.$price;
|
||||
$this->items[] = $item;
|
||||
|
||||
}
|
||||
|
|
|
@ -54,11 +54,11 @@ class PickyWallpapersBridge extends BridgeAbstract {
|
|||
|
||||
foreach($html->find('.items li img') as $element) {
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = str_replace('www', 'wallpaper', $baseUri).'/'.$this->resolution.'/'.basename($element->src);
|
||||
$item->timestamp = time();
|
||||
$item->title = $element->alt;
|
||||
$item->content = $item->title.'<br><a href="'.$item->uri.'">'.$element.'</a>';
|
||||
$item = array();
|
||||
$item['uri'] = str_replace('www', 'wallpaper', $baseUri).'/'.$this->resolution.'/'.basename($element->src);
|
||||
$item['timestamp'] = time();
|
||||
$item['title'] = $element->alt;
|
||||
$item['content'] = $item['title'].'<br><a href="'.$item['uri'].'">'.$element.'</a>';
|
||||
$this->items[] = $item;
|
||||
|
||||
$num++;
|
||||
|
|
|
@ -57,9 +57,9 @@ class PinterestBridge extends BridgeAbstract{
|
|||
|
||||
$img = $a->find('img', 0);
|
||||
|
||||
$item = new \Item();
|
||||
$item->uri = $this->getURI().$a->getAttribute('href');
|
||||
$item->content = '<img src="' . htmlentities(str_replace('/236x/', '/736x/', $img->getAttribute('src'))) . '" alt="" />';
|
||||
$item = array();
|
||||
$item['uri'] = $this->getURI().$a->getAttribute('href');
|
||||
$item['content'] = '<img src="' . htmlentities(str_replace('/236x/', '/736x/', $img->getAttribute('src'))) . '" alt="" />';
|
||||
|
||||
|
||||
if (isset($this->query))
|
||||
|
@ -72,17 +72,17 @@ class PinterestBridge extends BridgeAbstract{
|
|||
$username = $div->find('div.creditName', 0);
|
||||
$board = $div->find('div.creditTitle', 0);
|
||||
|
||||
$item->username =$username->innertext;
|
||||
$item->fullname = $board->innertext;
|
||||
$item->avatar = $avatar;
|
||||
$item['username'] =$username->innertext;
|
||||
$item['fullname'] = $board->innertext;
|
||||
$item['avatar'] = $avatar;
|
||||
|
||||
$item->content .= '<br /><img align="left" style="margin: 2px 4px;" src="'.htmlentities($item->avatar).'" /> <strong>'.$item->username.'</strong>';
|
||||
$item->content .= '<br />'.$item->fullname;
|
||||
$item['content'] .= '<br /><img align="left" style="margin: 2px 4px;" src="'.htmlentities($item['avatar']).'" /> <strong>'.$item['username'].'</strong>';
|
||||
$item['content'] .= '<br />'.$item['fullname'];
|
||||
}
|
||||
|
||||
$item->title = $img->getAttribute('alt');
|
||||
$item['title'] = $img->getAttribute('alt');
|
||||
|
||||
//$item->timestamp = $media->created_time;
|
||||
//$item['timestamp'] = $media->created_time;
|
||||
$this->items[] = $item;
|
||||
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ class PlanetLibreBridge extends BridgeAbstract{
|
|||
$limit = 0;
|
||||
foreach($html->find('div.post') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = $element->find('h1', 0)->plaintext;
|
||||
$item->uri = $element->find('a', 0)->href;
|
||||
$item->timestamp = strtotime(str_replace('/', '-', $element->find('div[class="post-date"]', 0)->plaintext));
|
||||
$item->content = $this->PlanetLibreExtractContent($item->uri);
|
||||
$item = array();
|
||||
$item['title'] = $element->find('h1', 0)->plaintext;
|
||||
$item['uri'] = $element->find('a', 0)->href;
|
||||
$item['timestamp'] = strtotime(str_replace('/', '-', $element->find('div[class="post-date"]', 0)->plaintext));
|
||||
$item['content'] = $this->PlanetLibreExtractContent($item['uri']);
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -16,18 +16,18 @@ class ProjectMGameBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM('http://projectmgame.com/en/') or $this->returnServerError('Error while downloading the Project M homepage');
|
||||
|
||||
foreach($html->find('article') as $article) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://projectmgame.com/en/'.$article->find('section div.info_block a',0)->href;
|
||||
$item->title = $article->find('h1 p',0)->innertext;
|
||||
$item = array();
|
||||
$item['uri'] = 'http://projectmgame.com/en/'.$article->find('section div.info_block a',0)->href;
|
||||
$item['title'] = $article->find('h1 p',0)->innertext;
|
||||
|
||||
$p_list = $article->find('section p');
|
||||
$content = '';
|
||||
foreach($p_list as $p) $content .= $p->innertext;
|
||||
$item->content = $content;
|
||||
$item['content'] = $content;
|
||||
|
||||
// get publication date
|
||||
$str_date = $article->find('section div.info_block a',0)->innertext;
|
||||
$item->timestamp = strtotime($str_date);
|
||||
$item['timestamp'] = strtotime($str_date);
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,15 +25,15 @@ class RTBFBridge extends BridgeAbstract {
|
|||
|
||||
foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element) {
|
||||
if($count < $limit) {
|
||||
$item = new \Item();
|
||||
$item->id = $element->getAttribute('data-id');
|
||||
$item->uri = 'http://www.rtbf.be/auvio/detail?id='.$item->id;
|
||||
$item = array();
|
||||
$item['id'] = $element->getAttribute('data-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'));
|
||||
$thumbnailUriLastSrc = end($thumbnailUriSrcSet);
|
||||
$thumbnailUri = explode(' ', $thumbnailUriLastSrc)[0];
|
||||
$item->title = trim($element->find('h3',0)->plaintext) . ' - ' . trim($element->find('h4',0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('time', 0)->getAttribute('datetime'));
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a>';
|
||||
$item['title'] = trim($element->find('h3',0)->plaintext) . ' - ' . trim($element->find('h4',0)->plaintext);
|
||||
$item['timestamp'] = strtotime($element->find('time', 0)->getAttribute('datetime'));
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a>';
|
||||
$this->items[] = $item;
|
||||
$count++;
|
||||
}
|
||||
|
|
|
@ -103,12 +103,12 @@ class Releases3DSBridge extends BridgeAbstract {
|
|||
.'</ul>';
|
||||
|
||||
//Build and add final item with the above three sections
|
||||
$item = new \Item();
|
||||
$item->title = $name;
|
||||
$item->author = $publisher;
|
||||
$item->timestamp = $ignDate;
|
||||
$item->uri = empty($ignLink) ? $searchLinkDuckDuckGo : $ignLink;
|
||||
$item->content = $ignDescription.$releaseDescription.$releaseSearchLinks;
|
||||
$item = array();
|
||||
$item['title'] = $name;
|
||||
$item['author'] = $publisher;
|
||||
$item['timestamp'] = $ignDate;
|
||||
$item['uri'] = empty($ignLink) ? $searchLinkDuckDuckGo : $ignLink;
|
||||
$item['content'] = $ignDescription.$releaseDescription.$releaseSearchLinks;
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@ class ReporterreBridge extends BridgeAbstract{
|
|||
|
||||
foreach($html->find('item') as $element) {
|
||||
if($limit < 5) {
|
||||
$item = new \Item();
|
||||
$item->title = html_entity_decode($element->find('title', 0)->plaintext);
|
||||
$item->timestamp = strtotime($element->find('dc:date', 0)->plaintext);
|
||||
$item->uri = $element->find('guid', 0)->innertext;
|
||||
$item->content = html_entity_decode($this->ExtractContentReporterre($item->uri));
|
||||
$item = array();
|
||||
$item['title'] = html_entity_decode($element->find('title', 0)->plaintext);
|
||||
$item['timestamp'] = strtotime($element->find('dc:date', 0)->plaintext);
|
||||
$item['uri'] = $element->find('guid', 0)->innertext;
|
||||
$item['content'] = html_entity_decode($this->ExtractContentReporterre($item['uri']));
|
||||
$this->items[] = $item;
|
||||
$limit++;
|
||||
}
|
||||
|
|
|
@ -30,12 +30,12 @@ class Rue89Bridge extends BridgeAbstract{
|
|||
|
||||
$datas = $this->rue89getDatas(str_replace('#commentaires', '', ($element->find('comments', 0)->plaintext)));
|
||||
|
||||
$item = new \Item();
|
||||
$item->title = $datas["title"];
|
||||
$item->author = $datas["author"][0]["name"];
|
||||
$item->timestamp = $datas["updated"];
|
||||
$item->content = $datas["body"];
|
||||
$item->uri = $datas["url"];
|
||||
$item = array();
|
||||
$item['title'] = $datas["title"];
|
||||
$item['author'] = $datas["author"][0]["name"];
|
||||
$item['timestamp'] = $datas["updated"];
|
||||
$item['content'] = $datas["body"];
|
||||
$item['uri'] = $datas["url"];
|
||||
|
||||
$this->items[] = $item;
|
||||
|
||||
|
|
|
@ -32,14 +32,14 @@ class Rule34Bridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=content] span') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://rule34.xxx/'.$element->find('a', 0)->href;
|
||||
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item->timestamp = time();
|
||||
$item = array();
|
||||
$item['uri'] = 'http://rule34.xxx/'.$element->find('a', 0)->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = $element->find('img', 0)->src;
|
||||
$item->tags = $element->find('img', 0)->getAttribute('alt');
|
||||
$item->title = 'Rule34 | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->find('img', 0)->getAttribute('alt');
|
||||
$item['title'] = 'Rule34 | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,14 +30,14 @@ class Rule34pahealBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=shm-image-list] div[class=shm-thumb]') as $element) {
|
||||
$item = new \Item();
|
||||
$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->timestamp = time();
|
||||
$item = array();
|
||||
$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['timestamp'] = time();
|
||||
$thumbnailUri = $element->find('img', 0)->src;
|
||||
$item->tags = $element->getAttribute('data-tags');
|
||||
$item->title = 'Rule34paheal | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->getAttribute('data-tags');
|
||||
$item['title'] = 'Rule34paheal | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,14 +32,14 @@ class SafebooruBridge extends BridgeAbstract{
|
|||
|
||||
|
||||
foreach($html->find('div[class=content] span') as $element) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://safebooru.org/'.$element->find('a', 0)->href;
|
||||
$item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item->timestamp = time();
|
||||
$item = array();
|
||||
$item['uri'] = 'http://safebooru.org/'.$element->find('a', 0)->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('id'));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = $element->find('img', 0)->src;
|
||||
$item->tags = $element->find('img', 0)->getAttribute('alt');
|
||||
$item->title = 'Safebooru | '.$item->postid;
|
||||
$item->content = '<a href="' . $item->uri . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item->tags;
|
||||
$item['tags'] = $element->find('img', 0)->getAttribute('alt');
|
||||
$item['title'] = 'Safebooru | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,13 +34,13 @@ class SakugabooruBridge extends BridgeAbstract{
|
|||
|
||||
foreach($data as $datai) {
|
||||
$json = json_decode($datai, TRUE);
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://sakuga.yshi.org/post/show/'.$json['id'];
|
||||
$item->postid = $json['id'];
|
||||
$item->timestamp = $json['created_at'];
|
||||
$item->imageUri = $json['file_url'];
|
||||
$item->title = 'Sakugabooru | '.$json['id'];
|
||||
$item->content = '<a href="' . $item->imageUri . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
|
||||
$item = array();
|
||||
$item['uri'] = 'http://sakuga.yshi.org/post/show/'.$json['id'];
|
||||
$item['postid'] = $json['id'];
|
||||
$item['timestamp'] = $json['created_at'];
|
||||
$item['imageUri'] = $json['file_url'];
|
||||
$item['title'] = 'Sakugabooru | '.$json['id'];
|
||||
$item['content'] = '<a href="' . $item['imageUri'] . '"><img src="' . $json['preview_url'] . '" /></a><br>Tags: '.$json['tags'];
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,9 +15,9 @@ class ScmbBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM('http://secouchermoinsbete.fr/') or $this->returnServerError('Could not request Se Coucher Moins Bete.');
|
||||
|
||||
foreach($html->find('article') as $article) {
|
||||
$item = new \Item();
|
||||
$item->uri = 'http://secouchermoinsbete.fr'.$article->find('p.summary a',0)->href;
|
||||
$item->title = $article->find('header h1 a',0)->innertext;
|
||||
$item = array();
|
||||
$item['uri'] = 'http://secouchermoinsbete.fr'.$article->find('p.summary a',0)->href;
|
||||
$item['title'] = $article->find('header h1 a',0)->innertext;
|
||||
|
||||
$article->find('span.read-more',0)->outertext=''; // remove text "En savoir plus" from anecdote content
|
||||
$content = $article->find('p.summary a',0)->innertext;
|
||||
|
@ -29,10 +29,10 @@ class ScmbBridge extends BridgeAbstract{
|
|||
list($y, $m, $d) = explode('-', $date);
|
||||
list($h, $i) = explode(':', $time);
|
||||
$timestamp = mktime($h,$i,0,$m,$d,$y);
|
||||
$item->timestamp = $timestamp;
|
||||
$item['timestamp'] = $timestamp;
|
||||
|
||||
|
||||
$item->content = $content;
|
||||
$item['content'] = $content;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ class ScoopItBridge extends BridgeAbstract{
|
|||
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request ScoopIt. for : ' . $link);
|
||||
|
||||
foreach($html->find('div.post-view') as $element) {
|
||||
$item = new Item();
|
||||
$item->uri = $element->find('a', 0)->href;
|
||||
$item->title = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_title',0)->plaintext);
|
||||
$item->content = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_description', 0)->plaintext);
|
||||
$item = array();
|
||||
$item['uri'] = $element->find('a', 0)->href;
|
||||
$item['title'] = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_title',0)->plaintext);
|
||||
$item['content'] = preg_replace('~[[:cntrl:]]~', '', $element->find('div.tCustomization_post_description', 0)->plaintext);
|
||||
$this->items[] = $item;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -109,16 +109,16 @@ class SensCritiqueBridge extends BridgeAbstract {
|
|||
}
|
||||
|
||||
foreach ($list->find('li') as $movie) {
|
||||
$item = new \Item();
|
||||
$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->content = '<em>' . $movie->find('.elco-original-title', 0)->plaintext . '</em><br><br>' .
|
||||
$item = array();
|
||||
$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['content'] = '<em>' . $movie->find('.elco-original-title', 0)->plaintext . '</em><br><br>' .
|
||||
$movie->find('.elco-baseline', 0)->plaintext . '<br>' .
|
||||
$movie->find('.elco-baseline', 1)->plaintext . '<br><br>' .
|
||||
$movie->find('.elco-description', 0)->plaintext . '<br><br>' .
|
||||
trim($movie->find('.erra-ratings .erra-global', 0)->plaintext) . ' / 10';
|
||||
$item->id = $this->getURI() . $movie->find('.elco-title a', 0)->href;
|
||||
$item->uri = $this->getURI() . $movie->find('.elco-title a', 0)->href;
|
||||
$item['id'] = $this->getURI() . $movie->find('.elco-title a', 0)->href;
|
||||
$item['uri'] = $this->getURI() . $movie->find('.elco-title a', 0)->href;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,30 +23,30 @@ $replace = array('January', 'February', 'March', 'April', 'May', 'June', 'July',
|
|||
// if you ask about that method_exists, there seems to be a bug in simple html dom
|
||||
// see stackoverflow for more details : http://stackoverflow.com/a/10828479/15619
|
||||
if(is_object($element)) {
|
||||
$item = new Item();
|
||||
$item = array();
|
||||
// various metadata
|
||||
$titleBlock = $element->find('.title-holder', 0);
|
||||
if(is_object($titleBlock)) {
|
||||
$titleDetails = $titleBlock->find('.article-title',0);
|
||||
$titleData = $titleDetails->find('h2', 0)->find('a',0);
|
||||
$titleTimestamp =$titleDetails->find('h4',0);
|
||||
$item->title = $this->correctCase(trim($titleData->innertext));
|
||||
$item->uri = $this->uri.$titleData->href;
|
||||
$item['title'] = $this->correctCase(trim($titleData->innertext));
|
||||
$item['uri'] = $this->uri.$titleData->href;
|
||||
|
||||
// Fugly date parsing due to the fact my DNS-323 doesn't support php intl extension
|
||||
$dateText = $titleTimestamp->innertext;
|
||||
$dateText = substr($dateText, strpos($dateText,',')+1);
|
||||
$dateText = str_replace($find, $replace, strtolower($dateText));
|
||||
$date = strtotime($dateText);
|
||||
$item->timestamp = $date;
|
||||
$item['timestamp'] = $date;
|
||||
|
||||
$item->author = "Maïa Mazaurette";
|
||||
$item['author'] = "Maïa Mazaurette";
|
||||
$elementText = $element->find('.text-container', 0);
|
||||
// don't forget to replace images server url with gq one
|
||||
foreach($elementText->find('img') as $image) {
|
||||
$image->src = $this->uri.$image->src;
|
||||
}
|
||||
$item->content = $elementText->innertext;
|
||||
$item['content'] = $elementText->innertext;
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue