diff --git a/bridges/AcrimedBridge.php b/bridges/AcrimedBridge.php new file mode 100644 index 00000000..c09d4667 --- /dev/null +++ b/bridges/AcrimedBridge.php @@ -0,0 +1,49 @@ +', '', $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/BastaBridge.php b/bridges/BastaBridge.php new file mode 100644 index 00000000..f056a656 --- /dev/null +++ b/bridges/BastaBridge.php @@ -0,0 +1,48 @@ +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/IdenticaBridge.php b/bridges/IdenticaBridge.php deleted file mode 100644 index 8d4ede50..00000000 --- a/bridges/IdenticaBridge.php +++ /dev/null @@ -1,44 +0,0 @@ -request = $param['u']; - $html = file_get_html('https://identi.ca/'.urlencode($this->request)) or $this->returnError('Requested username can\'t be found.', 404); - } - else { - $this->returnError('You must specify an Identica username (?u=...).', 400); - } - - 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; - $this->items[] = $item; - } - } - - public function getName(){ - return (!empty($this->request) ? $this->request .' - ' : '') .'Identica Bridge'; - } - - public function getURI(){ - return 'https://identica.com'; - } - - public function getCacheDuration(){ - return 300; // 5 minutes - } -} diff --git a/bridges/NextInpactBridge.php b/bridges/NextInpactBridge.php new file mode 100644 index 00000000..e3fad83f --- /dev/null +++ b/bridges/NextInpactBridge.php @@ -0,0 +1,52 @@ +', '', $string); + return $string; + } + function ExtractContent($url) { + $html2 = file_get_html($url); + $text = $html2->find('div#actu_content', 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 < 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 'Nextinpact Bridge'; + } + + public function getURI(){ + return 'http://www.nextinpact.com/'; + } + + public function getCacheDuration(){ + return 3600*2; // 2 hours + // return 0; + } +} diff --git a/bridges/ScilogsBridge.php b/bridges/ScilogsBridge.php new file mode 100644 index 00000000..90915be5 --- /dev/null +++ b/bridges/ScilogsBridge.php @@ -0,0 +1,51 @@ +', '', $string); + return $string; + } + function ScilogsExtractContent($url) { + $html2 = file_get_html($url); + $text = $html2->find('div.entrybody', 0)->innertext; + return $text; + } + $html = file_get_html('http://www.scilogs.fr/?wpmu-feed=posts') or $this->returnError('Could not request Scilogs.', 404); + $limit = 0; + + foreach($html->find('item') as $element) { + if($limit < 10) { + $item = new \Item(); + $item->title = ScilogsStripCDATA($element->find('title', 0)->innertext); + $item->uri = ScilogsStripCDATA($element->find('guid', 0)->plaintext); + $item->timestamp = strtotime($element->find('pubDate', 0)->plaintext); + $item->content = ScilogsExtractContent($item->uri); + $this->items[] = $item; + $limit++; + } + } + + } + + public function getName(){ + return 'Scilogs Bridge'; + } + + public function getURI(){ + return 'http://scilogs.fr/'; + } + + public function getCacheDuration(){ + return 3600*2; // 2 hours + } +}