diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php new file mode 100644 index 00000000..97a2e4a7 --- /dev/null +++ b/bridges/AcrimedBridge.php @@ -0,0 +1,52 @@ +', '', $string); + return $string; + } + function ExtractContent($url) { + $html2 = file_get_html($url); + $text = $html2->find('div.texte', 0)->innertext; + return $text; + } + $html = file_get_html('http://www.acrimed.org/spip.php?page=backend') or $this->returnError('Could not request Acrimed.', 404); + $limit = 0; + + foreach($html->find('item') as $element) { + if($limit < 10) { + $item = new \Item(); + $item->title = StripCDATA($element->find('title', 0)->innertext); + $item->uri = StripCDATA($element->find('guid', 0)->plaintext); + $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); + $item->content = ExtractContent($item->uri); + $this->items[] = $item; + $limit++; + } + } + + } + + public function getName(){ + return 'Acrimed Bridge'; + } + + public function getURI(){ + return 'http://acrimed.org/'; + } + + public function getCacheDuration(){ + return 3600*2; // 2 hours + // return 0; // 2 hours + } +} diff --git a/bridges/AllocineFRBridge.php b/bridges/AllocineFRBridge.php new file mode 100644 index 00000000..8844520d --- /dev/null +++ b/bridges/AllocineFRBridge.php @@ -0,0 +1,55 @@ +_URL) or $this->returnError('Could not request Allo cine.', 404); + + foreach($html->find('figure.media-meta-fig') as $element) + { + $item = new Item(); + + $titre = $element->find('div.titlebar h3.title a', 0); + $content = trim($element->innertext); + + $figCaption = strpos($content, $this->_NOM); + if($figCaption !== false) + { + $content = str_replace('src="/', 'src="http://www.allocine.fr/',$content); + $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($titre->innertext); + $item->uri = "http://www.allocine.fr" . $titre->href; + $this->items[] = $item; + } + } + } + + public function getName(){ + return 'Allo Cine : ' . $this->_NOM; + } + + public function getURI(){ + return $this->_URL; + } + + public function getCacheDuration(){ + return 25200; // 7 hours + } + public function getDescription(){ + return "Allo Cine : " . $this->_NOM . " via rss-bridge"; + } +} +?> diff --git a/bridges/AllocineT5Bridge.php b/bridges/AllocineT5Bridge.php new file mode 100644 index 00000000..f763428f --- /dev/null +++ b/bridges/AllocineT5Bridge.php @@ -0,0 +1,55 @@ +_URL) or $this->returnError('Could not request Allo cine.', 404); + + foreach($html->find('figure.media-meta-fig') as $element) + { + $item = new Item(); + + $titre = $element->find('div.titlebar h3.title a', 0); + $content = trim($element->innertext); + + $figCaption = strpos($content, $this->_NOM); + if($figCaption !== false) + { + $content = str_replace('src="/', 'src="http://www.allocine.fr/',$content); + $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($titre->innertext); + $item->uri = "http://www.allocine.fr" . $titre->href; + $this->items[] = $item; + } + } + } + + public function getName(){ + return 'Allo Cine : ' . $this->_NOM; + } + + public function getURI(){ + return $this->_URL; + } + + public function getCacheDuration(){ + return 25200; // 7 hours + } + public function getDescription(){ + return "Allo Cine : " . $this->_NOM . " via rss-bridge"; + } +} +?> diff --git a/bridges/AllocineTueursEnSerieBridge.php b/bridges/AllocineTueursEnSerieBridge.php new file mode 100644 index 00000000..772c870f --- /dev/null +++ b/bridges/AllocineTueursEnSerieBridge.php @@ -0,0 +1,55 @@ +_URL) or $this->returnError('Could not request Allo cine.', 404); + + foreach($html->find('figure.media-meta-fig') as $element) + { + $item = new Item(); + + $titre = $element->find('div.titlebar h3.title a', 0); + $content = trim($element->innertext); + + $figCaption = strpos($content, $this->_NOM); + if($figCaption !== false) + { + $content = str_replace('src="/', 'src="http://www.allocine.fr/',$content); + $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($titre->innertext); + $item->uri = "http://www.allocine.fr" . $titre->href; + $this->items[] = $item; + } + } + } + + public function getName(){ + return 'Allo Cine : ' . $this->_NOM; + } + + public function getURI(){ + return $this->_URL; + } + + public function getCacheDuration(){ + return 25200; // 7 hours + } + public function getDescription(){ + return "Allo Cine : " . $this->_NOM . " via rss-bridge"; + } +} +?> diff --git a/bridges/Arte7deBridge.php b/bridges/Arte7deBridge.php new file mode 100644 index 00000000..9cd3148f --- /dev/null +++ b/bridges/Arte7deBridge.php @@ -0,0 +1,78 @@ +returnError('Could not request ARTE.', 404); + + foreach($input_json['videos'] as $element) { + $item = new \Item(); + $item->uri = 'http://www.arte.tv'.$element['url']; + $item->postid = $item->uri; + + $date = $element['airdate_long']; + $date = explode(' ', $date); + $day = (int)$date['1']; + $month=FALSE; + switch ($date['2']) { + case 'Januar': + $month=1;break; + case 'Februar': + $month=2;break; + case 'März': + $month=3;break; + case 'April': + $month=4;break; + case 'Mai': + $month=5;break; + case 'Juni': + $month=6;break; + case 'Juli': + $month=7;break; + case 'August': + $month=8;break; + case 'September': + $month=9;break; + case 'Oktober': + $month=10;break; + case 'November': + $month=11;break; + case 'Dezember': + $month=12;break; + } + $year=(int)date('Y'); + $heure=explode(':', $date['4']); + $hour=(int)$heure['0']; + $minute=(int)$heure['1']; + + + $item->timestamp = mktime($hour, $minute, 0, $month, $day, $year); + $item->thumbnailUri = $element['image_url']; + $item->title = $element['title']; + $item->content = $element['desc'].'

'.$element['video_channels'].', '.$element['duration'].'min
'; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Arte7de'; + } + + public function getURI(){ + return 'http://www.arte.tv/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/Arte7frBridge.php b/bridges/Arte7frBridge.php new file mode 100644 index 00000000..6e444a68 --- /dev/null +++ b/bridges/Arte7frBridge.php @@ -0,0 +1,78 @@ +returnError('Could not request ARTE.', 404); + + foreach($input_json['videos'] as $element) { + $item = new \Item(); + $item->uri = 'http://www.arte.tv'.$element['url']; + $item->postid = $item->uri; + + $date = $element['airdate_long']; + $date = explode(' ', $date); + $day = (int)$date['1']; + $month=FALSE; + switch ($date['2']) { + case 'janvier': + $month=1;break; + case 'février': + $month=2;break; + case 'mars': + $month=3;break; + case 'avril': + $month=4;break; + case 'mai': + $month=5;break; + case 'juin': + $month=6;break; + case 'juillet': + $month=7;break; + case 'août': + $month=8;break; + case 'septembre': + $month=9;break; + case 'octobre': + $month=10;break; + case 'novembre': + $month=11;break; + case 'décembre': + $month=12;break; + } + $year=(int)date('Y'); + $heure=explode('h', $date['4']); + $hour=(int)$heure['0']; + $minute=(int)$heure['1']; + + + $item->timestamp = mktime($hour, $minute, 0, $month, $day, $year); + $item->thumbnailUri = $element['image_url']; + $item->title = $element['title']; + $item->content = $element['desc'].'

'.$element['video_channels'].', '.$element['duration'].'min
'; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Arte7fr'; + } + + public function getURI(){ + return 'http://www.arte.tv/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/BastaBridge.php b/bridges/BastaBridge.php new file mode 100644 index 00000000..976240fe --- /dev/null +++ b/bridges/BastaBridge.php @@ -0,0 +1,51 @@ +find('div.texte', 0)->innertext; + return $text; + } + $html = file_get_html('http://www.bastamag.net/spip.php?page=backend') or $this->returnError('Could not request Bastamag.', 404); + $limit = 0; + + 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 = BastaExtractContent($item->uri); + $this->items[] = $item; + $limit++; + } + } + + } + + public function getName(){ + return 'Bastamag Bridge'; + } + + public function getURI(){ + return 'http://bastamag.net/'; + } + + public function getCacheDuration(){ + return 3600*2; // 2 hours + // return 0; // 2 hours + } +} diff --git a/bridges/BlaguesDeMerdeBridge.php b/bridges/BlaguesDeMerdeBridge.php new file mode 100644 index 00000000..c7caed6f --- /dev/null +++ b/bridges/BlaguesDeMerdeBridge.php @@ -0,0 +1,48 @@ +returnError('Could not request BDM.', 404); + + foreach($html->find('article.joke_contener') as $element) { + $item = new Item(); + $temp = $element->find('a'); + if(isset($temp[2])) + { + $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)); + $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->name = $element->find("li.bdm_pseudo",0)->innertext;; + $this->items[] = $item; + } + } + } + + public function getName(){ + return 'blaguesdemerde'; + } + + public function getURI(){ + return 'http://www.blaguesdemerde.fr/'; + } + + public function getCacheDuration(){ + return 7200; // 2h hours + } + public function getDescription(){ + return "Blagues De Merde via rss-bridge"; + } +} +?> diff --git a/bridges/BooruprojectBridge.php b/bridges/BooruprojectBridge.php new file mode 100644 index 00000000..60c05eaf --- /dev/null +++ b/bridges/BooruprojectBridge.php @@ -0,0 +1,55 @@ +returnError('Please enter a ***.booru.org instance.', 404); + } + $html = file_get_html("http://".$param['i'].".booru.org/index.php?page=post&s=list&pid=".$page.$tags) or $this->returnError('Could not request Booruproject.', 404); + + + 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->thumbnailUri = $element->find('img', 0)->src; + $item->tags = $element->find('img', 0)->getAttribute('title'); + $item->title = 'Booruproject '.$param['i'].' | '.$item->postid; + $item->content = '
Tags: '.$item->tags; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Booruproject'; + } + + public function getURI(){ + return 'http://booru.org/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/CopieDoubleBridge.php b/bridges/CopieDoubleBridge.php new file mode 100644 index 00000000..c163bf6b --- /dev/null +++ b/bridges/CopieDoubleBridge.php @@ -0,0 +1,59 @@ +returnError('Could not request CopieDouble.', 404); + $table = $html->find('table table', 2); + + foreach($table->find('tr') as $element) + { + $td = $element->find('td', 0); + $cpt++; + if($td->class == "couleur_1") + { + $item = new Item(); + + $title = $td->innertext; + $pos = strpos($title, "title = $title; + } + elseif(strpos($element->innertext, "/images/suivant.gif") === false) + { + $a=$element->find("a", 0); + $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; + $this->items[] = $item; + } + } + } + + public function getName(){ + return 'CopieDouble'; + } + + public function getURI(){ + return 'http://www.copie-double.com'; + } + + public function getDescription(){ + return 'CopieDouble via rss-bridge'; + } + + public function getCacheDuration(){ + return 14400; // 4 hours + } +} + +?> diff --git a/bridges/DanbooruBridge.php b/bridges/DanbooruBridge.php new file mode 100644 index 00000000..5cdd4dcf --- /dev/null +++ b/bridges/DanbooruBridge.php @@ -0,0 +1,48 @@ +returnError('Could not request Danbooru.', 404); + 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->thumbnailUri = 'http://donmai.us'.$element->find('img', 0)->src; + $item->tags = $element->find('img', 0)->getAttribute('alt'); + $item->title = 'Danbooru | '.$item->postid; + $item->content = '
Tags: '.$item->tags; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Danbooru'; + } + + public function getURI(){ + return 'http://donmai.us/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php new file mode 100644 index 00000000..a80d8de3 --- /dev/null +++ b/bridges/DilbertBridge.php @@ -0,0 +1,45 @@ +returnError('Could not request Dilbert.', 404); + + foreach($html->find('div.STR_Image') as $element) { + $item = new Item(); + $href = $element->find('a',0)->href; + $item->uri = 'http://dilbert.com' . $href; + $content = str_replace('src="/', 'src="http://dilbert.com/',$element->innertext); + $content = str_replace('href="/', 'href="http://dilbert.com/',$content); + $item->content = $content; + $time = strtotime(substr($href, (strrpos($href, "/", -10) + 1), 10)); + $item->title = date("d/m/Y", $time); + $item->timestamp = $time; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Dilbert'; + } + + public function getURI(){ + return 'http://dilbert.com'; + } + + public function getDescription(){ + return 'Dilbert via rss-bridge'; + } + + public function getCacheDuration(){ + return 14400; // 4 hours + } +} +?> diff --git a/bridges/DollbooruBridge.php b/bridges/DollbooruBridge.php new file mode 100644 index 00000000..6534ab8b --- /dev/null +++ b/bridges/DollbooruBridge.php @@ -0,0 +1,50 @@ +returnError('Could not request Dollbooru.', 404); + + + foreach($html->find('div[class=shm-image-list] center[class=shm-thumb]') as $element) { + $item = new \Item(); + $item->uri = 'http://dollbooru.org'.$element->find('a', 0)->href; + $item->postid = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-post-id')); + $item->timestamp = time(); + $item->thumbnailUri = 'http://dollbooru.org'.$element->find('img', 0)->getAttribute('data-original'); + $item->tags = $element->getAttribute('data-tags'); + $item->title = 'Dollbooru | '.$item->postid; + $item->content = '
Tags: '.$item->tags; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Dollbooru'; + } + + public function getURI(){ + return 'http://dollbooru.org/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/FootitoBridge.php b/bridges/FootitoBridge.php new file mode 100644 index 00000000..2731d5c7 --- /dev/null +++ b/bridges/FootitoBridge.php @@ -0,0 +1,58 @@ +returnError('Could not request Footito.', 404); + + foreach($html->find('div.post') as $element) { + $item = new Item(); + + $content = trim($element->innertext); + $content = str_replace("content = $content; + + $title = $element->find('.contenu .texte ', 0)->plaintext; + $item->title = $title; + + $info = $element->find('div.infos', 0); + + $item->timestamp = strtotime($info->find('time', 0)->datetime); + $item->name = $info->find('a.auteur', 0)->plaintext; + + $this->items[] = $item; + } + } + + public function getName(){ + return 'footito'; + } + + public function getURI(){ + return 'http://www.footito.fr/'; + } + + public function getCacheDuration(){ + return 3600; // 1h hours + } + public function getDescription(){ + return "Footito via rss-bridge"; + } +} +?> diff --git a/bridges/GelbooruBridge.php b/bridges/GelbooruBridge.php new file mode 100644 index 00000000..86d77a70 --- /dev/null +++ b/bridges/GelbooruBridge.php @@ -0,0 +1,52 @@ +returnError('Could not request Gelbooru.', 404); + + + 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->thumbnailUri = $element->find('img', 0)->src; + $item->tags = $element->find('img', 0)->getAttribute('alt'); + $item->title = 'Gelbooru | '.$item->postid; + $item->content = '
Tags: '.$item->tags; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Gelbooru'; + } + + public function getURI(){ + return 'http://gelbooru.com/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/KonachanBridge.php b/bridges/KonachanBridge.php new file mode 100644 index 00000000..b4df4076 --- /dev/null +++ b/bridges/KonachanBridge.php @@ -0,0 +1,54 @@ +returnError('Could not request Konachan.', 404); + $input_json = explode('Post.register(', $html); + foreach($input_json as $element) + $data[] = preg_replace('/}\)(.*)/', '}', $element); + unset($data[0]); + + 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->thumbnailUri = $json['preview_url']; + $item->title = 'Konachan | '.$json['id']; + $item->content = '
Tags: '.$json['tags']; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Konachan'; + } + + public function getURI(){ + return 'http://konachan.com/post'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/LesJoiesDuCodeBridge.php b/bridges/LesJoiesDuCodeBridge.php new file mode 100644 index 00000000..0550d238 --- /dev/null +++ b/bridges/LesJoiesDuCodeBridge.php @@ -0,0 +1,58 @@ +returnError('Could not request LesJoiesDuCode.', 404); + + foreach($html->find('div.post') as $element) { + $item = new Item(); + $temp = $element->find('h3 a', 0); + + $titre = $temp->innertext; + $url = $temp->href; + + $temp = $element->find('div.bodytype', 0); + $content = $temp->innertext; + + $auteur = $temp->find('.c1 em', 0); + $pos = strpos($auteur->innertext, "by"); + + if($pos > 0) + { + $auteur = trim(str_replace("*/", "", substr($auteur->innertext, ($pos + 2)))); + $item->name = $auteur; + } + + + $item->content .= trim($content); + $item->uri = $url; + $item->title = trim($titre); + + $this->items[] = $item; + } + } + + public function getName(){ + return 'Les Joies Du Code'; + } + + public function getURI(){ + return 'http://lesjoiesducode.fr/'; + } + + public function getCacheDuration(){ + return 7200; // 2h hours + } + public function getDescription(){ + return "Les Joies Du Code via rss-bridge"; + } +} +?> diff --git a/bridges/MalikiBridge.php b/bridges/MalikiBridge.php new file mode 100644 index 00000000..55b09ab1 --- /dev/null +++ b/bridges/MalikiBridge.php @@ -0,0 +1,42 @@ +returnError('Could not request Maliki.', 404); + $count=0; + foreach($html->find('div.boite_strip') as $element) { + if(!empty($element->find('a',0)->href) and $count < 20) { + $item = new \Item(); + $item->uri = 'http://www.maliki.com/'.$element->find('a',0)->href; + $item->thumbnailUri = 'http://www.maliki.com/'.$element->find('img',0)->src; + $item->title = $element->find('img',0)->title; + $item->timestamp = strtotime(str_replace('/', '-', $element->find('span.stylepetit', 0)->innertext)); + $item->content = ''; + $this->items[] = $item; + $count++; + } + } + } + + public function getName(){ + return 'Maliki'; + } + + public function getURI(){ + return 'http://www.maliki.com/'; + } + + public function getCacheDuration(){ + return 86400; // 24 hours + } +} diff --git a/bridges/MilbooruBridge.php b/bridges/MilbooruBridge.php new file mode 100644 index 00000000..9059fa79 --- /dev/null +++ b/bridges/MilbooruBridge.php @@ -0,0 +1,50 @@ +returnError('Could not request Milbooru.', 404); + + + 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->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 = '
Tags: '.$item->tags; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Milbooru'; + } + + public function getURI(){ + return 'http://sheslostcontrol.net/moe/shimmie/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/MspabooruBridge.php b/bridges/MspabooruBridge.php new file mode 100644 index 00000000..b3d3b61a --- /dev/null +++ b/bridges/MspabooruBridge.php @@ -0,0 +1,52 @@ +returnError('Could not request Mspabooru.', 404); + + + 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->thumbnailUri = $element->find('img', 0)->src; + $item->tags = $element->find('img', 0)->getAttribute('alt'); + $item->title = 'Mspabooru | '.$item->postid; + $item->content = '
Tags: '.$item->tags; + $this->items[] = $item; + } + } + + public function getName(){ + return 'Mspabooru'; + } + + public function getURI(){ + return 'http://mspabooru.com/'; + } + + public function getCacheDuration(){ + return 1800; // 30 minutes + } +} diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php new file mode 100644 index 00000000..ad1d785f --- /dev/null +++ b/bridges/NextInpactBridge.php @@ -0,0 +1,55 @@ +', '', $string); + return $string; + } + function ExtractContent($url) { + $html2 = file_get_html($url); + $text = $html2->find('div[itemprop=articleBody]', 0)->innertext; + return $text; + } + $html = file_get_html('http://www.nextinpact.com/rss/news.xml') or $this->returnError('Could not request Nextinpact.', 404); + $limit = 0; + + foreach($html->find('item') as $element) { + if($limit < 3) { + $item = new \Item(); + $item->title = StripCDATA($element->find('title', 0)->innertext); + $item->uri = StripCDATA($element->find('guid', 0)->plaintext); + $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); + $item->content = ExtractContent($item->uri); + $this->items[] = $item; + $limit++; + } + } + + } + + public function getName(){ + return 'Nextinpact Bridge'; + } + + public function getURI(){ + return 'http://www.nextinpact.com/'; + } + + public function getCacheDuration(){ + return 3600; // 1 hour + // return 0; + } +} diff --git a/bridges/NumeramaBridge.php b/bridges/NumeramaBridge.php new file mode 100644 index 00000000..3f3f0fda --- /dev/null +++ b/bridges/NumeramaBridge.php @@ -0,0 +1,56 @@ +', '', $string); + return $string; + } + function NumeramaExtractContent($url) { + $html2 = file_get_html($url); + $text = $html2->find('h2.intro', 0)->innertext; + $text = $text.$html2->find('div.content', 0)->innertext; + $text = preg_replace('/