1
0
Fork 0
forked from blallo/rss-bridge
This commit is contained in:
logmanoriginal 2016-08-28 20:33:27 +02:00
commit 8ed3b02899
133 changed files with 2159 additions and 2646 deletions

View file

@ -1,16 +1,10 @@
<?php
class ABCTabsBridge extends BridgeAbstract{
private $request;
public function loadMetadatas() {
$this->maintainer = "kranack";
$this->name = "ABC Tabs Bridge";
$this->uri = "http://www.abc-tabs.com/";
$this->description = "Returns 22 newest tabs";
}
public $maintainer = "kranack";
public $name = "ABC Tabs Bridge";
public $uri = "http://www.abc-tabs.com/";
public $description = "Returns 22 newest tabs";
public function collectData(){
$html = '';

View file

@ -1,18 +1,15 @@
<?php
class AcrimedBridge extends RssExpander{
public function loadMetadatas() {
$this->maintainer = "qwertygc";
$this->name = "Acrimed Bridge";
$this->uri = "http://www.acrimed.org/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "qwertygc";
public $name = "Acrimed Bridge";
public $uri = "http://www.acrimed.org/";
public $description = "Returns the newest articles.";
public function collectData(){
parent::collectExpandableDatas("http://www.acrimed.org/spip.php?page=backend");
$this->collectExpandableDatas("http://www.acrimed.org/spip.php?page=backend");
}

View file

@ -1,58 +1,60 @@
<?php
class AllocineFRBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "superbaillot.net";
$this->name = "Allo Cine Bridge";
$this->uri = "http://www.allocine.fr";
$this->description = "Bridge for allocine.fr";
$this->parameters[] = array(
'category'=>array(
public $maintainer = "superbaillot.net";
public $name = "Allo Cine Bridge";
public $uri = "http://www.allocine.fr";
public $description = "Bridge for allocine.fr";
public $parameters = array( array(
'category'=>array(
'name'=>'category',
'type'=>'list',
'required'=>true,
'exampleValue'=>'Faux Raccord',
'title'=>'Select your category',
'values'=>array(
'Faux Raccord'=>'faux-raccord',
'Top 5'=>'top-5',
'Tueurs En Serie'=>'tuers-en-serie'
'Faux Raccord'=>'faux-raccord',
'Top 5'=>'top-5',
'Tueurs en Séries'=>'tueurs-en-serie'
)
)
);
)
));
public function getURI(){
switch($this->getInput('category')){
case 'faux-raccord':
$uri = 'http://www.allocine.fr/video/programme-12284/saison-24580/';
break;
case 'top-5':
$uri = 'http://www.allocine.fr/video/programme-12299/saison-22542/';
break;
case 'tueurs-en-serie':
$uri = 'http://www.allocine.fr/video/programme-12286/saison-22938/';
break;
}
return $uri;
}
public function getName(){
return $this->name.' : '
.array_search(
$this->getInput('category'),
$this->parameters[$this->queriedContext]['category']['values']
);
}
public function collectData(){
$params=$this->parameters[$this->queriedContext];
// Check all parameters
if(!isset($params['category']['value']))
$this->returnClientError('You must specify a valid category (&category= )!');
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError("Could not request ".$this->getURI()." !");
$category = '';
switch($params['category']['value']){
case 'faux-raccord':
$this->uri = 'http://www.allocine.fr/video/programme-12284/saison-24580/';
$category = 'Faux Raccord';
break;
case 'top-5':
$this->uri = 'http://www.allocine.fr/video/programme-12299/saison-22542/';
$category = 'Top 5';
break;
case 'tuers-en-serie':
$this->uri = 'http://www.allocine.fr/video/programme-12286/saison-22938/';
$category = 'Tueurs en Séries';
break;
default:
$this->returnClientError('You must select a valid category!');
}
$category=array_search(
$this->getInput('category'),
$this->parameters[$this->queriedContext]['category']['values']
);
// Update bridge name to match selection
$this->name .= ' : ' . $category;
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError("Could not request {$this->uri}!");
foreach($html->find('figure.media-meta-fig') as $element)
{

View file

@ -1,16 +1,11 @@
<?php
class AnimeUltimeBridge extends BridgeAbstract {
private $filter = 'Releases';
public function loadMetadatas() {
$this->maintainer = 'ORelio';
$this->name = 'Anime-Ultime';
$this->uri = 'http://www.anime-ultime.net/';
$this->description = 'Returns the 10 newest releases posted on Anime-Ultime';
$this->parameters[] = array(
public $maintainer = 'ORelio';
public $name = 'Anime-Ultime';
public $uri = 'http://www.anime-ultime.net/';
public $description = 'Returns the 10 newest releases posted on Anime-Ultime';
public $parameters = array( array(
'type'=>array(
'name'=>'Type',
'type'=>'list',
@ -21,22 +16,17 @@ class AnimeUltimeBridge extends BridgeAbstract {
'Tokusatsu'=>'T'
)
)
);
}
));
private $filter = 'Releases';
public function collectData(){
$param=$this->parameters[$this->queriedContext];
//Add type filter if provided
$typeFilter = '';
if (!empty($param['type']['value'])) {
if ($param['type']['value'] == 'A' || $param['type']['value'] == 'D' || $param['type']['value'] == 'T') {
$typeFilter = $param['type']['value'];
if ($typeFilter == 'A') { $this->filter = 'Anime'; }
if ($typeFilter == 'D') { $this->filter = 'Drama'; }
if ($typeFilter == 'T') { $this->filter = 'Tokusatsu'; }
} else $this->returnClientError('The provided type filter is invalid. Expecting A, D, T, or no filter');
}
$typeFilter = array_search(
$this->getInput('type'),
$this->parameters[$this->queriedContext]['type']['values']
);
//Build date and filters for making requests
$thismonth = date('mY').$typeFilter;
@ -47,9 +37,9 @@ class AnimeUltimeBridge extends BridgeAbstract {
foreach (array($thismonth, $lastmonth) as $requestFilter) {
//Retrive page contents
$website = 'http://www.anime-ultime.net/';
$url = $website.'history-0-1/'.$requestFilter;
$html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request Anime-Ultime: '.$url);
$url = $this->uri.'history-0-1/'.$requestFilter;
$html = $this->getSimpleHTMLDOM($url)
or $this->returnServerError('Could not request Anime-Ultime: '.$url);
//Relases are sorted by day : process each day individually
foreach ($html->find('div.history', 0)->find('h3') as $daySection) {
@ -57,7 +47,9 @@ class AnimeUltimeBridge extends BridgeAbstract {
//Retrieve day and build date information
$dateString = $daySection->plaintext;
$day = intval(substr($dateString, strpos($dateString, ' ') + 1, 2));
$item_date = strtotime(str_pad($day, 2, '0', STR_PAD_LEFT).'-'.substr($requestFilter, 0, 2).'-'.substr($requestFilter, 2, 4));
$item_date = strtotime(str_pad($day, 2, '0', STR_PAD_LEFT).'-'
.substr($requestFilter, 0, 2).'-'
.substr($requestFilter, 2, 4));
$release = $daySection->next_sibling()->next_sibling()->first_child(); //<h3>day</h3><br /><table><tr> <-- useful data in table rows
//Process each release of that day, ignoring first table row: contains table headers
@ -66,7 +58,7 @@ class AnimeUltimeBridge extends BridgeAbstract {
//Retrieve metadata from table columns
$item_link_element = $release->find('td', 0)->find('a', 0);
$item_uri = $website.$item_link_element->href;
$item_uri = $this->uri.$item_link_element->href;
$item_name = html_entity_decode($item_link_element->plaintext);
$item_episode = html_entity_decode(str_pad($release->find('td', 1)->plaintext, 2, '0', STR_PAD_LEFT));
$item_fansub = $release->find('td', 2)->plaintext;
@ -75,10 +67,21 @@ class AnimeUltimeBridge extends BridgeAbstract {
if (!empty($item_uri)) {
//Retrieve description from description page and convert relative image src info absolute image src
$html_item = $this->getContents($item_uri) or $this->returnServerError('Could not request Anime-Ultime: '.$item_uri);
$item_description = substr($html_item, strpos($html_item, 'class="principal_contain" align="center">') + 41);
$item_description = substr($item_description, 0, strpos($item_description, '<div id="table">'));
$item_description = str_replace('src="images', 'src="'.$website.'images', $item_description);
$html_item = $this->getContents($item_uri)
or $this->returnServerError('Could not request Anime-Ultime: '.$item_uri);
$item_description = substr(
$html_item,
strpos($html_item, 'class="principal_contain" align="center">')
+ 41
);
$item_description = substr($item_description,
0,
strpos($item_description, '<div id="table">')
);
$item_description = str_replace(
'src="images', 'src="'.$this->uri.'images',
$item_description
);
$item_description = str_replace("\r", '', $item_description);
$item_description = str_replace("\n", '', $item_description);
$item_description = utf8_encode($item_description);
@ -104,7 +107,12 @@ class AnimeUltimeBridge extends BridgeAbstract {
}
public function getName() {
return 'Latest '.$this->filter.' - Anime-Ultime Bridge';
$typeFilter = array_search(
$this->getInput('type'),
$this->parameters[$this->queriedContext]['type']['values']
);
return 'Latest '.$typeFilter.' - Anime-Ultime Bridge';
}
public function getCacheDuration() {

View file

@ -3,14 +3,10 @@
#error_reporting(E_ALL);
class ArstechnicaBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = "prysme";
$this->name = "ArstechnicaBridge";
$this->uri = "http://arstechnica.com";
$this->description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion";
}
public $maintainer = "prysme";
public $name = "ArstechnicaBridge";
public $uri = "http://arstechnica.com";
public $description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion";
function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {

View file

@ -1,75 +1,73 @@
<?php
class Arte7Bridge extends BridgeAbstract{
<?php
class Arte7Bridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "Arte +7";
$this->uri = "http://www.arte.tv/";
$this->description = "Returns newest videos from ARTE +7";
$this->parameters["Catégorie (Français)"] = array(
'catfr'=>array(
'type'=>'list',
'name'=>'Catégorie',
'values'=>array(
'Toutes les vidéos (français)'=>'toutes-les-videos',
'Actu & société'=>'actu-société',
'Séries & fiction'=>'séries-fiction',
'Cinéma'=>'cinéma',
'Arts & spectacles classiques'=>'arts-spectacles-classiques',
'Culture pop'=>'culture-pop',
'Découverte'=>'découverte',
'Histoire'=>'histoire',
'Junior'=>'junior'
public $maintainer = "mitsukarenai";
public $name = "Arte +7";
public $uri = "http://www.arte.tv/";
public $description = "Returns newest videos from ARTE +7";
public $parameters = array(
'Catégorie (Français)' => array(
'catfr'=>array(
'type'=>'list',
'name'=>'Catégorie',
'values'=>array(
'Toutes les vidéos (français)'=>'toutes-les-videos',
'Actu & société'=>'actu-société',
'Séries & fiction'=>'séries-fiction',
'Cinéma'=>'cinéma',
'Arts & spectacles classiques'=>'arts-spectacles-classiques',
'Culture pop'=>'culture-pop',
'Découverte'=>'découverte',
'Histoire'=>'histoire',
'Junior'=>'junior'
)
)
),
'Catégorie (Allemand)' => array(
'catde'=>array(
'type'=>'list',
'name'=>'Catégorie',
'values'=>array(
'Alle Videos (deutsch)'=>'alle-videos',
'Aktuelles & Gesellschaft'=>'aktuelles-gesellschaft',
'Fernsehfilme & Serien'=>'fernsehfilme-serien',
'Kino'=>'kino',
'Kunst & Kultur'=>'kunst-kultur',
'Popkultur & Alternativ'=>'popkultur-alternativ',
'Entdeckung'=>'entdeckung',
'Geschichte'=>'geschichte',
'Junior'=>'junior'
)
)
)
)
);
$this->parameters["Catégorie (Allemand)"] = array(
'catde'=>array(
'type'=>'list',
'name'=>'Catégorie',
'values'=>array(
'Alle Videos (deutsch)'=>'alle-videos',
'Aktuelles & Gesellschaft'=>'aktuelles-gesellschaft',
'Fernsehfilme & Serien'=>'fernsehfilme-serien',
'Kino'=>'kino',
'Kunst & Kultur'=>'kunst-kultur',
'Popkultur & Alternativ'=>'popkultur-alternativ',
'Entdeckung'=>'entdeckung',
'Geschichte'=>'geschichte',
'Junior'=>'junior'
)
)
);
}
protected function extractVideoset($category='toutes-les-videos', $lang='fr'){
$url = 'http://www.arte.tv/guide/'.$lang.'/plus7/'.$category;
$input = $this->getContents($url) or die('Could not request ARTE.');
if(strpos($input, 'categoryVideoSet') !== FALSE){
$input = explode('categoryVideoSet: ', $input);
$input = explode('}},', $input[1]);
$input = $input[0].'}}';
}else{
$input = explode('videoSet: ', $input);
$input = explode('}]},', $input[1]);
$input = $input[0].'}]}';
}
$input = json_decode($input, TRUE);
return $input;
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$category='toutes-les-videos'; $lang='fr';
if (!empty($param['catfr']['value']))
$category=$param['catfr']['value'];
if (!empty($param['catde']['value']))
{ $category=$param['catde']['value']; $lang='de'; }
$input_json = $this->extractVideoset($category, $lang);
switch($this->queriedContext){
case 'Catégorie (Français)':
$category=$this->getInput('catfr');
$lang='fr';
break;
case 'Catégorie (Allemand)':
$category=$this->getInput('catde');
$lang='de';
break;
}
$url = $this->uri.'guide/'.$lang.'/plus7/'.$category;
$input = $this->getContents($url) or die('Could not request ARTE.');
if(strpos($input, 'categoryVideoSet') !== FALSE){
$input = explode('categoryVideoSet: ', $input);
$input = explode('}},', $input[1]);
$input = $input[0].'}}';
}else{
$input = explode('videoSet: ', $input);
$input = explode('}]},', $input[1]);
$input = $input[0].'}]}';
}
$input_json = json_decode($input, TRUE);
foreach($input_json['videos'] as $element) {
$item = array();

View file

@ -1,35 +1,26 @@
<?php
class AskfmBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "az5he6ch";
$this->name = "Ask.fm Answers";
$this->uri = "http://ask.fm/";
$this->description = "Returns answers from an Ask.fm user";
$this->parameters["Ask.fm username"] = array(
'u'=>array(
'name'=>'Username',
'required'=>true
)
);
}
public $maintainer = "az5he6ch";
public $name = "Ask.fm Answers";
public $uri = "http://ask.fm/";
public $description = "Returns answers from an Ask.fm user";
public $parameters = array(
'Ask.fm username'=>array(
'u'=>array(
'name'=>'Username',
'required'=>true
)
)
);
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (isset($param['u']['value'])) {
$this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://ask.fm/'.urlencode($this->request).'/answers/more?page=0') or $this->returnServerError('Requested username can\'t be found.');
}
else {
$this->returnClientError('You must specify a username (?u=...).');
}
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Requested username can\'t be found.');
foreach($html->find('div.streamItem-answer') as $element) {
$item = array();
$item['uri'] = 'http://ask.fm'.$element->find('a.streamItemsAge',0)->href;
$item['uri'] = $this->uri.$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));
$answer = trim($element->find('p.streamItemContent-answer',0)->innertext);
@ -44,18 +35,18 @@ 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);
$content = preg_replace('#href="\/(?!\/)#', 'href="'.$this->uri,$content);
$item['content'] = $content;
$this->items[] = $item;
}
}
public function getName(){
return empty($this->request) ? $this->name : $this->request;
return $this->name.' : '.$this->getInput('u');
}
public function getURI(){
return empty($this->request) ? $this->uri : 'http://ask.fm/'.urlencode($this->request);
return $this->uri.urlencode($this->getInput('u')).'/answers/more?page=0';
}
public function getCacheDuration(){

View file

@ -1,33 +1,21 @@
<?php
class BandcampBridge extends BridgeAbstract{
private $request;
public function loadMetadatas() {
$this->maintainer = "sebsauvage";
$this->name = "Bandcamp Tag";
$this->uri = "http://bandcamp.com/";
$this->description = "New bandcamp release by tag";
$this->parameters[] = array(
'tag'=>array(
public $maintainer = "sebsauvage";
public $name = "Bandcamp Tag";
public $uri = "http://bandcamp.com/";
public $description = "New bandcamp release by tag";
public $parameters = array( array(
'tag'=>array(
'name'=>'tag',
'type'=>'text'
)
);
}
'type'=>'text',
'required'=>true
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (isset($param['tag']['value'])) {
$this->request = $param['tag']['value'];
$html = $this->getSimpleHTMLDOM('http://bandcamp.com/tag/'.urlencode($this->request).'?sort_field=date') or $this->returnServerError('No results for this query.');
}
else {
$this->returnClientError('You must specify tag (/tag/...)');
}
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('No results for this query.');
foreach($html->find('li.item') as $release) {
$script = $release->find('div.art', 0)->getAttribute('onclick');
@ -44,8 +32,12 @@ class BandcampBridge extends BridgeAbstract{
}
}
public function getURI(){
return $this->uri.'tag/'.urlencode($this->getInput('tag')).'?sort_field=date';
}
public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Bandcamp Tag';
return $this->getInput('tag') .' - '.'Bandcamp Tag';
}
public function getCacheDuration(){

View file

@ -1,19 +1,18 @@
<?php
class BastaBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "qwertygc";
$this->name = "Bastamag Bridge";
$this->uri = "http://www.bastamag.net/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "qwertygc";
public $name = "Bastamag Bridge";
public $uri = "http://www.bastamag.net/";
public $description = "Returns the newest articles.";
public function collectData(){
// Replaces all relative image URLs by absolute URLs. Relative URLs always start with 'local/'!
function ReplaceImageUrl($content){
return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\'http://www.bastamag.net/$1\'', $content);
return preg_replace('/src=["\']{1}([^"\']+)/ims', 'src=\''.$this->uri.'$1\'', $content);
}
$html = $this->getSimpleHTMLDOM('http://www.bastamag.net/spip.php?page=backend') or $this->returnServerError('Could not request Bastamag.');
$html = $this->getSimpleHTMLDOM($this->uri.'spip.php?page=backend')
or $this->returnServerError('Could not request Bastamag.');
$limit = 0;
foreach($html->find('item') as $element) {

View file

@ -1,17 +1,15 @@
<?php
class BlaguesDeMerdeBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "superbaillot.net";
public $name = "Blagues De Merde";
public $uri = "http://www.blaguesdemerde.fr/";
public $description = "Blagues De Merde";
$this->maintainer = "superbaillot.net";
$this->name = "Blagues De Merde";
$this->uri = "http://www.blaguesdemerde.fr/";
$this->description = "Blagues De Merde";
}
public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.blaguesdemerde.fr/') or $this->returnServerError('Could not request BDM.');
$html = $this->getSimpleHTMLDOM($this->uri)
or $this->returnServerError('Could not request BDM.');
foreach($html->find('article.joke_contener') as $element) {
$item = array();

View file

@ -1,48 +1,42 @@
<?php
class BooruprojectBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Booruproject";
public $uri = "http://booru.org/";
public $description = "Returns images from given page and booruproject instance (****.booru.org)";
$this->maintainer = "mitsukarenai";
$this->name = "Booruproject";
$this->uri = "http://booru.org/";
$this->description = "Returns images from given page and booruproject instance (****.booru.org)";
$this->parameters[] = array(
public $parameters = array( array(
'i'=>array(
'name'=>'instance (required)',
'required'=>true
),
'p'=>array('name'=>'page'),
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
));
function getURI(){
return 'http://'.$this->getInput('i').'.booru.org/';
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0; $tags = '';
if (!empty($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
$page = $page - 1;
$page = $page * 20;
}
if (!empty($param['t']['value'])) {
$tags = '&tags='.urlencode($param['t']['value']);
}
if (empty($param['i']['value'])) {
$this->returnServerError('Please enter a ***.booru.org instance.');
}
$html = $this->getSimpleHTMLDOM("http://".$param['i']['value'].".booru.org/index.php?page=post&s=list&pid=".$page.$tags) or $this->returnServerError('Could not request Booruproject.');
$html = $this->getSimpleHTMLDOM(
$this->getURI().'index.php?page=post&s=list'
.'&pid='.($this->getInput('p')?($this->getInput('p') -1)*20:'')
.'&tags='.urlencode($this->getInput('t'))
) or $this->returnServerError('Could not request Booruprojec.');
foreach($html->find('div[class=content] span') as $element) {
$item = array();
$item['uri'] = 'http://'.$param['i']['value'].'.booru.org/'.$element->find('a', 0)->href;
$item['uri'] = $this->getURI().$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']['value'].' | '.$item['postid'];
$item['title'] = 'Booruproject '.$this->getInput('i').' | '.$item['postid'];
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $element->find('img', 0)->src . '" /></a><br>Tags: '.$item['tags'];
$this->items[] = $item;
}

View file

@ -1,11 +1,9 @@
<?php
class CADBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "nyutag";
$this->name = "CAD Bridge";
$this->uri = "http://www.cad-comic.com/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "nyutag";
public $name = "CAD Bridge";
public $uri = "http://www.cad-comic.com/";
public $description = "Returns the newest articles.";
private function CADExtractContent($url) {
$html3 = $this->getSimpleHTMLDOM($url);

View file

@ -1,22 +1,16 @@
<?php
class CNETBridge extends BridgeAbstract {
private $topicName = '';
public $maintainer = 'ORelio';
public $name = 'CNET News';
public $uri = 'http://www.cnet.com/';
public $description = 'Returns the newest articles. <br /> You may specify a topic found in some section URLs, else all topics are selected.';
public function loadMetadatas() {
$this->maintainer = 'ORelio';
$this->name = 'CNET News';
$this->uri = 'http://www.cnet.com/';
$this->description = 'Returns the newest articles. <br /> You may specify a topic found in some section URLs, else all topics are selected.';
$this->parameters[] = array(
'topic'=>array('name'=>'Topic name')
);
}
public $parameters = array( array(
'topic'=>array('name'=>'Topic name')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
@ -43,10 +37,7 @@ class CNETBridge extends BridgeAbstract {
return $article_html;
}
if (!empty($param['topic']['value']))
$this->topicName = $param['topic']['value'];
$pageUrl = 'http://www.cnet.com/'.(empty($this->topicName) ? '' : 'topics/'.$this->topicName.'/');
$pageUrl = $this->uri.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/');
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
$limit = 0;
@ -54,7 +45,7 @@ class CNETBridge extends BridgeAbstract {
if ($limit < 8) {
$article_title = trim($element->find('h2', 0)->plaintext);
$article_uri = 'http://www.cnet.com'.($element->find('a', 0)->href);
$article_uri = $this->uri.($element->find('a', 0)->href);
$article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext);
$article_author = trim($element->find('a[rel=author]', 0)->plaintext);
@ -78,7 +69,7 @@ class CNETBridge extends BridgeAbstract {
}
public function getName() {
return 'CNET News Bridge'.(empty($this->topicName) ? '' : ' - '.$this->topicName);
return 'CNET News Bridge'.(empty($this->getInput('topic')) ? '' : ' - '.$this->getInput('topic'));
}
public function getCacheDuration() {

View file

@ -1,31 +1,31 @@
<?php
class CastorusBridge extends BridgeAbstract {
public function loadMetadatas(){
$this->maintainer = "logmanoriginal";
$this->name = "Castorus Bridge";
$this->uri = 'http://www.castorus.com';
$this->description = "Returns the latest changes";
public $maintainer = "logmanoriginal";
public $name = "Castorus Bridge";
public $uri = 'http://www.castorus.com';
public $description = "Returns the latest changes";
$this->parameters["Get latest changes"] = array();
$this->parameters["Get latest changes via ZIP code"] = array(
'zip'=>array(
'name'=>'ZIP code',
'type'=>'text',
'required'=>true,
'exampleValue'=>'74910, 74',
'title'=>'Insert ZIP code (complete or partial)'
)
);
$this->parameters["Get latest changes via city name"] = array(
'city'=>array(
'name'=>'City name',
'type'=>'text',
'required'=>true,
'exampleValue'=>'Seyssel, Seys',
'title'=>'Insert city name (complete or partial)'
)
);
}
public $parameters = array(
'Get latest changes' => array(),
'Get latest changes via ZIP code' => array(
'zip'=>array(
'name'=>'ZIP code',
'type'=>'text',
'required'=>true,
'exampleValue'=>'74910, 74',
'title'=>'Insert ZIP code (complete or partial)'
)
),
'Get latest changes via city name' => array(
'city'=>array(
'name'=>'City name',
'type'=>'text',
'required'=>true,
'exampleValue'=>'Seyssel, Seys',
'title'=>'Insert city name (complete or partial)'
)
)
);
// Extracts the tile from an actitiy
private function ExtractActivityTitle($activity){
@ -74,12 +74,8 @@ class CastorusBridge extends BridgeAbstract {
}
public function collectData(){
$params=$this->parameters[$this->queriedContext];
if(isset($params['zip']['value']))
$zip_filter = trim($params['zip']['value']);
if(isset($params['city']['value']))
$city_filter = trim($params['city']['value']);
$zip_filter = trim($this->getInput('zip'));
$city_filter = trim($this->getInput('city'));
$html = $this->getSimpleHTMLDOM($this->uri);

View file

@ -1,12 +1,10 @@
<?php
class CollegeDeFranceBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "pit-fgfjiudghdf";
$this->name = "CollegeDeFrance";
$this->uri = "http://www.college-de-france.fr/";
$this->description = "Returns the latest audio and video from CollegeDeFrance";
}
public $maintainer = "pit-fgfjiudghdf";
public $name = "CollegeDeFrance";
public $uri = "http://www.college-de-france.fr/";
public $description = "Returns the latest audio and video from CollegeDeFrance";
public function collectData(){
$months = array(
@ -32,7 +30,8 @@ class CollegeDeFranceBridge extends BridgeAbstract{
* </a>
* </li>
*/
$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.');
$html = $this->getSimpleHTMLDOM($this->uri.'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 = array();
$item['title'] = $element->find('.title', 0)->plaintext;
@ -45,10 +44,25 @@ class CollegeDeFranceBridge extends BridgeAbstract{
// <a href="/site/institut-physique/The-Mysteries-of-Decoherence-Sebastien-Gleyzes-[Video-3-35].htm" data-target="after">
$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');
$d = DateTime::createFromFormat(
'!Y-m-d-H\hi',
substr($element->href, strpos($element->href, '201'), 16),
$timezone
);
if(!$d){
$d=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['uri'] = $this->uri . $element->href;
$this->items[] = $item;
}
}

View file

@ -1,12 +1,10 @@
<?php
class CommonDreamsBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "nyutag";
$this->name = "CommonDreams Bridge";
$this->uri = "http://www.commondreams.org/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "nyutag";
public $name = "CommonDreams Bridge";
public $uri = "http://www.commondreams.org/";
public $description = "Returns the newest articles.";
private function CommonDreamsExtractContent($url) {
$html3 = $this->getSimpleHTMLDOM($url);

View file

@ -1,24 +1,19 @@
<?php
class CopieDoubleBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "superbaillot.net";
$this->name = "CopieDouble";
$this->uri = "http://www.copie-double.com/";
$this->description = "CopieDouble";
}
public $maintainer = "superbaillot.net";
public $name = "CopieDouble";
public $uri = "http://www.copie-double.com/";
public $description = "CopieDouble";
public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.copie-double.com/') or $this->returnServerError('Could not request CopieDouble.');
$html = $this->getSimpleHTMLDOM($this->uri)
or $this->returnServerError('Could not request CopieDouble.');
$table = $html->find('table table', 2);
foreach($table->find('tr') as $element)
{
$td = $element->find('td', 0);
$cpt++;
if($td->class == "couleur_1")
{
$item = array();
@ -31,10 +26,10 @@ class CopieDoubleBridge extends BridgeAbstract{
elseif(strpos($element->innertext, "/images/suivant.gif") === false)
{
$a=$element->find("a", 0);
$item['uri'] = "http://www.copie-double.com" . $a->href;
$item['uri'] = $this->uri . $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);
$content = str_replace('src="/', 'src="/'.$this->uri,$element->find("td", 0)->innertext);
$content = str_replace('href="/', 'href="'.$this->uri,$content);
$item['content'] = $content;
$this->items[] = $item;
}

View file

@ -1,22 +1,15 @@
<?php
class CourrierInternationalBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "teromene";
$this->name = "Courrier International Bridge";
$this->uri = "http://CourrierInternational.fr/";
$this->description = "Courrier International bridge";
}
public $maintainer = "teromene";
public $name = "Courrier International Bridge";
public $uri = "http://CourrierInternational.com/";
public $description = "Courrier International bridge";
public function collectData(){
$html = '';
$html = $this->getSimpleHTMLDOM('http://www.courrierinternational.com/') or $this->returnServerError('Error.');
$html = $this->getSimpleHTMLDOM($this->uri)
or $this->returnServerError('Error.');
$element = $html->find("article");
@ -29,7 +22,7 @@ class CourrierInternationalBridge extends BridgeAbstract{
$item['uri'] = $article->parent->getAttribute("href");
if(strpos($item['uri'], "http") === FALSE) {
$item['uri'] = "http://courrierinternational.fr/".$item['uri'];
$item['uri'] = $this->uri.$item['uri'];
}
$page = $this->getSimpleHTMLDOM($item['uri']);

View file

@ -1,38 +1,28 @@
<?php
class CpasbienBridge extends HttpCachingBridgeAbstract{
public function loadMetadatas() {
public $maintainer = "lagaisse";
public $name = "Cpasbien Bridge";
public $uri = "http://www.cpasbien.io";
public $description = "Returns latest torrents from a request query";
$this->maintainer = "lagaisse";
$this->name = "Cpasbien Bridge";
$this->uri = "http://www.cpasbien.io";
$this->description = "Returns latest torrents from a request query";
$this->parameters[] = array(
'q'=>array(
public $parameters = array( array(
'q'=>array(
'name'=>'Search',
'required'=>true,
'title'=>'Type your search'
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (isset($param['q']['value'])) { /* keyword search mode */
$request = str_replace(" ","-",trim($param['q']['value']));
$html = $this->getSimpleHTMLDOM($this->uri.'/recherche/'.urlencode($request).'.html') or $this->returnServerError('No results for this query.');
} else {
$this->returnClientError('You must specify a keyword (?q=...).');
}
$request = str_replace(" ","-",trim($this->getInput('q')));
$html = $this->getSimpleHTMLDOM($this->uri.'/recherche/'.urlencode($request).'.html')
or $this->returnServerError('No results for this query.');
foreach ($html->find('#gauche',0)->find('div') as $episode) {
if ($episode->getAttribute('class')=='ligne0' || $episode->getAttribute('class')=='ligne1')
if ($episode->getAttribute('class')=='ligne0' ||
$episode->getAttribute('class')=='ligne1')
{
$htmlepisode=$this->get_cached($episode->find('a', 0)->getAttribute('href'));
$item = array();
@ -58,8 +48,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
public function getName(){
return $this->parameters[$this->queriedContext]['q']['value']
.' : '.$this->name;
return $this->getInput('q').' : '.$this->name;
}
public function getCacheDuration(){

View file

@ -1,43 +1,34 @@
<?php
class CryptomeBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "BoboTiG";
public $name = "Cryptome";
public $uri = "https://cryptome.org/";
public $description = "Returns the N most recent documents.";
$this->maintainer = "BoboTiG";
$this->name = "Cryptome";
$this->uri = "http://cryptome.org/";
$this->description = "Returns the N most recent documents.";
$this->parameters[] = array(
'n'=>array(
public $parameters = array( array(
'n'=>array(
'name'=>'number of elements',
'type'=>'number',
'defaultValue'=>20,
'exampleValue'=>10
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
$num = 20;
$link = 'http://cryptome.org/';
// If you want HTTPS access instead, uncomment the following line:
//$link = 'https://secure.netsolhost.com/cryptome.org/';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request Cryptome.');
if (!empty($param['n']['value'])) { /* number of documents */
$num = min(max(1, $param['n']['value']+0), $num);
$html = $this->getSimpleHTMLDOM($this->uri)
or $this->returnServerError('Could not request Cryptome.');
if (!empty($this->getInput('n'))) { /* number of documents */
$num = min($this->getInput('n'), 20);
}
foreach($html->find('pre') as $element) {
for ( $i = 0; $i < $num; ++$i ) {
$item = array();
$item['uri'] = $link.substr($element->find('a', $i)->href, 20);
$item['uri'] = $this->uri.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['content'] = preg_replace('#http://cryptome.org/#', $this->uri, $element->find('b', $i)->innertext);
$this->items[] = $item;
}
break;

View file

@ -1,92 +1,117 @@
<?php
class DailymotionBridge extends BridgeAbstract{
private $request;
public $maintainer = "mitsukarenai";
public $name = "Dailymotion Bridge";
public $uri = "https://www.dailymotion.com/";
public $description = "Returns the 5 newest videos by username/playlist or search";
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "Dailymotion Bridge";
$this->uri = "https://www.dailymotion.com/";
$this->description = "Returns the 5 newest videos by username/playlist or search";
$this->parameters["By username"] = array(
'u'=>array('name'=>'username')
);
$this->parameters["By playlist id"] = array(
'p'=>array(
'name'=>'playlist id',
'type'=>'text',
'required'=>true
)
);
$this->parameters["From search results"] = array(
's'=>array(
'name'=>'Search keyword',
'required'=>true
public $parameters = array (
'By username' => array(
'u'=>array(
'name'=>'username',
'required'=>true
)
),
'pa'=>array(
'name'=>'Page',
'type'=>'number'
)
'By playlist id' => array(
'p'=>array(
'name'=>'playlist id',
'required'=>true
)
),
'From search results' => array(
's'=>array(
'name'=>'Search keyword',
'required'=>true
),
'pa'=>array(
'name'=>'Page',
'type'=>'number'
)
)
);
}
function getMetadata($id) {
$metadata=array();
$html2 = $this->getSimpleHTMLDOM('http://www.dailymotion.com/video/'.$id) or $this->returnServerError('Could not request Dailymotion.');
$metadata['title'] = $html2->find('meta[property=og:title]', 0)->getAttribute('content');
$metadata['timestamp'] = strtotime($html2->find('meta[property=video:release_date]', 0)->getAttribute('content') );
$metadata['thumbnailUri'] = $html2->find('meta[property=og:image]', 0)->getAttribute('content');
$metadata['uri'] = $html2->find('meta[property=og:url]', 0)->getAttribute('content');
$metadata=array();
$html2 = $this->getSimpleHTMLDOM($this->uri.'video/'.$id);
if(!$html2){
return $metadata;
}
return $metadata;
$metadata['title'] = $html2->find('meta[property=og:title]', 0)->getAttribute('content');
$metadata['timestamp'] = strtotime($html2->find('meta[property=video:release_date]', 0)->getAttribute('content') );
$metadata['thumbnailUri'] = $html2->find('meta[property=og:image]', 0)->getAttribute('content');
$metadata['uri'] = $html2->find('meta[property=og:url]', 0)->getAttribute('content');
return $metadata;
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
$limit = 5;
$count = 0;
public function collectData(){
$html = '';
$limit = 5;
$count = 0;
if (isset($param['u']['value'])) { // user timeline mode
$this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/user/'.urlencode($this->request).'/1') or $this->returnServerError('Could not request Dailymotion.');
}
else if (isset($param['p']['value'])) { // playlist mode
$this->request = strtok($param['p']['value'], '_');
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/playlist/'.urlencode($this->request).'') or $this->returnServerError('Could not request Dailymotion.');
}
else if (isset($param['s']['value'])) { // search mode
$this->request = $param['s']['value']; $page = 1; if (isset($param['pa']['value'])) $page = (int)preg_replace("/[^0-9]/",'', $param['pa']['value']);
$html = $this->getSimpleHTMLDOM('http://www.dailymotion.com/search/'.urlencode($this->request).'/'.$page.'') or $this->returnServerError('Could not request Dailymotion.');
}
else {
$this->returnClientError('You must either specify a Dailymotion username (?u=...) or a playlist id (?p=...) or search (?s=...)');
}
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request Dailymotion.');
foreach($html->find('div.media a.preview_link') as $element) {
if($count < $limit) {
$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++;
}
}
}
foreach($html->find('div.media a.preview_link') as $element) {
if($count < $limit) {
$item = array();
$item['id'] = str_replace('/video/', '', strtok($element->href, '_'));
$metadata = $this->getMetadata($item['id']);
if(empty($metadata)){
continue;
}
$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++;
}
}
}
public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Dailymotion Bridge';
}
public function getName(){
switch($this->queriedContext){
case 'By username':
$specific=$this->getInput('u');
break;
case 'By playlist id':
$specific=strtok($this->getInput('p'), '_');
break;
case 'From search results':
$specific=$this->getInput('s');
break;
}
public function getCacheDuration(){
return 3600*3; // 3 hours
}
return $specific.' : Dailymotion Bridge';
}
public function getURI(){
$uri=$this->uri;
switch($this->queriedContext){
case 'By username':
$uri.='user/'
.urlencode($this->getInput('u')).'/1';
break;
case 'By playlist id':
$uri.='playlist/'
.urlencode(strtok($this->getInput('p'), '_'));
break;
case 'From search results':
$uri.='search/'
.urlencode($this->getInput('s'));
if($this->getInput('pa')){
$uri.='/'.$this->getInput('pa');
}
break;
}
return $uri;
}
public function getCacheDuration(){
return 3600*3; // 3 hours
}
}

View file

@ -1,35 +1,31 @@
<?php
class DanbooruBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Danbooru";
public $uri = "http://donmai.us/";
public $description = "Returns images from given page";
$this->maintainer = "mitsukarenai";
$this->name = "Danbooru";
$this->uri = "http://donmai.us/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array('name'=>'page'),
't'=>array('name'=>'tags')
);
}
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 1;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://donmai.us/posts?&page=$page&tags=$tags") or $this->returnServerError('Could not request Danbooru.');
$page = $this->getInput('p')?$this->getInput('p'):1;
$tags = urlencode($this->getInput('t'));
$html = $this->getSimpleHTMLDOM($this->uri."posts?&page=$page&tags=$tags")
or $this->returnServerError('Could not request Danbooru.');
foreach($html->find('div[id=posts] article') as $element) {
$item = array();
$item['uri'] = 'http://donmai.us'.$element->find('a', 0)->href;
$item['uri'] = $this->uri.$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;
$thumbnailUri = $this->uri.$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'];

View file

@ -1,20 +1,15 @@
<?php
class DansTonChatBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "Astalaseven";
$this->name = "DansTonChat Bridge";
$this->uri = "http://danstonchat.com";
$this->description = "Returns latest quotes from DansTonChat.";
}
public $maintainer = "Astalaseven";
public $name = "DansTonChat Bridge";
public $uri = "http://danstonchat.com/";
public $description = "Returns latest quotes from DansTonChat.";
public function collectData(){
$html = '';
$link = 'http://danstonchat.com/latest.html';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request DansTonChat.');
$html = $this->getSimpleHTMLDOM($this->uri.'latest.html')
or $this->returnServerError('Could not request DansTonChat.');
foreach($html->find('div.item') as $element) {
$item = array();

View file

@ -1,64 +1,52 @@
<?php
class DauphineLibereBridge extends BridgeAbstract {
public function loadMetadatas() {
public $maintainer = "qwertygc";
public $name = "Dauphine Bridge";
public $uri = "http://www.ledauphine.com/";
public $description = "Returns the newest articles.";
$this->maintainer = "qwertygc";
$this->name = "Dauphine Bridge";
$this->uri = "http://www.ledauphine.com/";
$this->description = "Returns the newest articles.";
$this->parameters[] = array(
'u'=>array(
public $parameters = array( array(
'u'=>array(
'name'=>'Catégorie de l\'article',
'type'=>'list',
'values'=>array(
'À la une'=>'',
'France Monde'=>'france-monde',
'Faits Divers'=>'faits-divers',
'Économie et Finance'=>'economie-et-finance',
'Politique'=>'politique',
'Sport'=>'sport',
'Ain'=>'ain',
'Alpes-de-Haute-Provence'=>'haute-provence',
'Hautes-Alpes'=>'hautes-alpes',
'Ardèche'=>'ardeche',
'Drôme'=>'drome',
'Isère Sud'=>'isere-sud',
'Savoie'=>'savoie',
'Haute-Savoie'=>'haute-savoie',
'Vaucluse'=>'vaucluse'
'À la une'=>'',
'France Monde'=>'france-monde',
'Faits Divers'=>'faits-divers',
'Économie et Finance'=>'economie-et-finance',
'Politique'=>'politique',
'Sport'=>'sport',
'Ain'=>'ain',
'Alpes-de-Haute-Provence'=>'haute-provence',
'Hautes-Alpes'=>'hautes-alpes',
'Ardèche'=>'ardeche',
'Drôme'=>'drome',
'Isère Sud'=>'isere-sud',
'Savoie'=>'savoie',
'Haute-Savoie'=>'haute-savoie',
'Vaucluse'=>'vaucluse'
)
)
);
}
)
));
private function ExtractContent($url, $context) {
$html2 = $this->getSimpleHTMLDOM($url,false,$context);
$html2 = $this->getSimpleHTMLDOM($url);
$text = $html2->find('div.column', 0)->innertext;
$text = preg_replace('@<script[^>]*?>.*?</script>@si', '', $text);
return $text;
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
// Simulate Mozilla user-agent to fix error 403 (Forbidden)
$opts = array('http' =>
array(
'method' => 'GET',
'header' => 'User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'
)
);
$context = stream_context_create($opts);
if (isset($param['u']['value'])) { /* user timeline mode */
$this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://www.ledauphine.com/'.$this->request.'/rss',false,$context) or $this->returnServerError('Could not request DauphineLibere.');
}
else {
$html = $this->getSimpleHTMLDOM('http://www.ledauphine.com/rss',false,$context) or $this->returnServerError('Could not request DauphineLibere.');
if (empty($this->getInput('u'))) {
$html = $this->getSimpleHTMLDOM($this->uri.$this->getInput('u').'/rss')
or $this->returnServerError('Could not request DauphineLibere.');
} else {
$html = $this->getSimpleHTMLDOM($this->uri.'rss')
or $this->returnServerError('Could not request DauphineLibere.');
}
$limit = 0;

View file

@ -1,54 +1,53 @@
<?php
class DemoBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "teromene";
public $name = "DemoBridge";
public $uri = "http://github.com/rss-bridge/rss-bridge";
public $description = "Bridge used for demos";
$this->maintainer = "teromene";
$this->name = "DemoBridge";
$this->uri = "http://github.com/sebsauvage/rss-bridge";
$this->description = "Bridge used for demos";
$this->parameters['testCheckbox'] = array(
'testCheckbox'=>array(
'type'=>'checkbox',
'name'=>'test des checkbox'
)
);
$this->parameters['testList'] = array(
'testList'=>array(
'type'=>'list',
'name'=>'test des listes',
'values'=>array(
'Test'=>'test',
'Test 2'=>'test2'
public $parameters = array(
'testCheckbox' => array(
'testCheckbox'=>array(
'type'=>'checkbox',
'name'=>'test des checkbox'
)
)
);
),
$this->parameters['testNumber'] = array(
'testNumber'=>array(
'type'=>'number',
'name'=>'test des numéros',
'exampleValue'=>'1515632'
)
);
}
'testList' => array(
'testList'=>array(
'type'=>'list',
'name'=>'test des listes',
'values'=>array(
'Test'=>'test',
'Test 2'=>'test2'
)
)
),
public function collectData(){
'testNumber' => array(
'testNumber'=>array(
'type'=>'number',
'name'=>'test des numéros',
'exampleValue'=>'1515632'
)
)
);
$item = array();
$item['author'] = "Me!";
$item['title'] = "Test";
$item['content'] = "Awesome content !";
$item['id'] = "Lalala";
$item['uri'] = "http://test.test/test";
public function collectData(){
$this->items[] = $item;
$item = array();
$item['author'] = "Me!";
$item['title'] = "Test";
$item['content'] = "Awesome content !";
$item['id'] = "Lalala";
$item['uri'] = "http://example.com/test";
$this->items[] = $item;
}
public function getCacheDuration(){
return 00; // 1 hour
}
public function getCacheDuration(){
return 00; // 1 hour
}
}

View file

@ -1,12 +1,10 @@
<?php
class DeveloppezDotComBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "polopollo";
$this->name = "Developpez.com Actus (FR)";
$this->uri = "http://www.developpez.com/";
$this->description = "Returns the 15 newest posts from DeveloppezDotCom (full text).";
}
public $maintainer = "polopollo";
public $name = "Developpez.com Actus (FR)";
public $uri = "http://www.developpez.com/";
public $description = "Returns the 15 newest posts from DeveloppezDotCom (full text).";
private function DeveloppezDotComStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
@ -41,7 +39,8 @@ class DeveloppezDotComBridge extends BridgeAbstract{
}
public function collectData(){
$rssFeed = $this->getSimpleHTMLDOM('http://www.developpez.com/index/rss') or $this->returnServerError('Could not request http://www.developpez.com/index/rss');
$rssFeed = $this->getSimpleHTMLDOM($this->uri.'index/rss')
or $this->returnServerError('Could not request '.$this->uri.'index/rss');
$limit = 0;
foreach($rssFeed->find('item') as $element) {

View file

@ -1,14 +1,10 @@
<?php
class DilbertBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = 'kranack';
$this->name = 'Dilbert Daily Strip';
$this->uri = 'http://dilbert.com';
$this->description = 'The Unofficial Dilbert Daily Comic Strip';
}
public $maintainer = 'kranack';
public $name = 'Dilbert Daily Strip';
public $uri = 'http://dilbert.com';
public $description = 'The Unofficial Dilbert Daily Comic Strip';
public function collectData(){

View file

@ -1,41 +1,33 @@
<?php
class DollbooruBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "Dollbooru";
$this->uri = "http://dollbooru.org/";
$this->description = "Returns images from given page";
public $maintainer = "mitsukarenai";
public $name = "Dollbooru";
public $uri = "http://dollbooru.org/";
public $description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
}
$html = $this->getSimpleHTMLDOM("http://dollbooru.org/post/list/$tags/$page") or $this->returnServerError('Could not request Dollbooru.');
$page=$this->getInput('p');
$tags = urlencode($this->getInput('t'));
$html = $this->getSimpleHTMLDOM($this->uri."post/list/$tags/$page")
or $this->returnServerError('Could not request Dollbooru.');
foreach($html->find('div[class=shm-image-list] a') as $element) {
$item = array();
$item['uri'] = 'http://dollbooru.org'.$element->href;
$item['uri'] = $this->uri.$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;
$thumbnailUri = $this->uri.$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'];

View file

@ -1,26 +1,20 @@
<?php
class DuckDuckGoBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "Astalaseven";
public $name = "DuckDuckGo";
public $uri = "https://duckduckgo.com/";
public $description = "Returns most recent results from DuckDuckGo.";
$this->maintainer = "Astalaseven";
$this->name = "DuckDuckGo";
$this->uri = "https://duckduckgo.com/";
$this->description = "Returns most recent results from DuckDuckGo.";
$this->parameters[] = array(
'u'=>array(
public $parameters = array( array(
'u'=>array(
'name'=>'keyword',
'required'=>true)
);
}
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
$link = 'http://duckduckgo.com/html/?q='.$param['u']['value'].'+sort:date';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request DuckDuckGo.');
$html = $this->getSimpleHTMLDOM($this->uri.'html/?q='.$this->getInput('u').'+sort:date')
or $this->returnServerError('Could not request DuckDuckGo.');
foreach($html->find('div.results_links') as $element) {
$item = array();

View file

@ -1,24 +1,20 @@
<?php
class EZTVBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "alexAubin";
public $name = "EZTV";
public $uri = "https://eztv.ch/";
public $description = "Returns list of *recent* torrents for a specific show on EZTV. Get showID from URLs in https://eztv.ch/shows/showID/show-full-name.";
$this->maintainer = "alexAubin";
$this->name = "EZTV";
$this->uri = "https://eztv.ch/";
$this->description = "Returns list of *recent* torrents for a specific show on EZTV. Get showID from URLs in https://eztv.ch/shows/showID/show-full-name.";
$this->parameters[] = array(
'i'=>array(
public $parameters = array( array(
'i'=>array(
'name'=>'Show ids',
'exampleValue'=>'showID1,showID2,…',
'required'=>true
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
// Make timestamp from relative released time in table
function makeTimestamp($relativeReleaseTime){
@ -33,16 +29,13 @@ class EZTVBridge extends BridgeAbstract{
return mktime(date('h')-$relativeHours,0,0,date('m'),date('d')-$relativeDays,date('Y'));
}
// Check for ID provided
if (!isset($param['i']['value']))
$this->returnClientError('You must provide a list of ID (?i=showID1,showID2,...)');
// Loop on show ids
$showList = explode(",",$param['i']['value']);
$showList = explode(",",$this->getInput('i'));
foreach($showList as $showID){
// Get show page
$html = $this->getSimpleHTMLDOM('https://eztv.ch/shows/'.rawurlencode($showID).'/') or $this->returnServerError('Could not request EZTV for id "'.$showID.'"');
$html = $this->getSimpleHTMLDOM($this->uri.'shows/'.rawurlencode($showID).'/')
or $this->returnServerError('Could not request EZTV for id "'.$showID.'"');
// Loop on each element that look like an episode entry...
foreach($html->find('.forum_header_border') as $element) {
@ -60,7 +53,7 @@ class EZTVBridge extends BridgeAbstract{
// Fill item
$item = array();
$item['uri'] = 'https://eztv.ch/'.$epinfo->href;
$item['uri'] = $this->uri.$epinfo->href;
$item['id'] = $item['uri'];
$item['timestamp'] = makeTimestamp($released->plaintext);
$item['title'] = $epinfo->plaintext;

View file

@ -1,23 +1,20 @@
<?php
class EliteDangerousGalnetBridge extends BridgeAbstract
{
public function loadMetadatas()
{
$this->maintainer = "corenting";
$this->name = "Elite: Dangerous Galnet";
$this->uri = "https://community.elitedangerous.com/galnet";
$this->description = "Returns the latest page of news from Galnet";
}
public $maintainer = "corenting";
public $name = "Elite: Dangerous Galnet";
public $uri = "https://community.elitedangerous.com/galnet/";
public $description = "Returns the latest page of news from Galnet";
public function collectData()
{
$html = $this->getSimpleHTMLDOM('https://community.elitedangerous.com/galnet') or $this->returnServerError('Error while downloading the website content');
$html = $this->getSimpleHTMLDOM($this->uri)
or $this->returnServerError('Error while downloading the website content');
foreach($html->find('div.article') as $element) {
$item = array();
$uri = $element->find('h3 a', 0)->href;
$uri = 'https://community.elitedangerous.com' . $uri;
$uri = $this->uri . substr($uri,strlen('/galnet/'));
$item['uri'] = $uri;
$title = $element->find('h3 a', 0)->plaintext;

View file

@ -1,21 +1,18 @@
<?php
class ElsevierBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = 'Pierre Mazière';
public $name = 'Elsevier journals recent articles';
public $uri = 'http://www.journals.elsevier.com/';
public $description = 'Returns the recent articles published in Elsevier journals';
$this->maintainer = 'Pierre Mazière';
$this->name = 'Elsevier journals recent articles';
$this->uri = 'http://www.journals.elsevier.com';
$this->description = 'Returns the recent articles published in Elsevier journals';
$this->parameters[] = array(
'j'=>array(
public $parameters = array( array(
'j'=>array(
'name'=>'Journal name',
'required'=>true,
'exampleValue'=>'academic-pediactrics',
'title'=>'Insert html-part of your journal'
)
);
}
)
));
// Extracts the list of names from an article as string
private function ExtractArticleName ($article){
@ -59,9 +56,8 @@ class ElsevierBridge extends BridgeAbstract{
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$uri = 'http://www.journals.elsevier.com/' . $param['j']['value'] . '/recent-articles/';
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$param['j']['value']);
$uri = $this->uri . $this->getInput('j') . '/recent-articles/';
$html = $this->getSimpleHTMLDOM($uri) or $this->returnServerError('No results for Elsevier journal '.$this->getInput('j'));
foreach($html->find('.pod-listing') as $article){
$item = array();

View file

@ -1,12 +1,10 @@
<?php
class EstCeQuonMetEnProdBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = 'ORelio';
$this->name = 'Est-ce qu\'on met en prod aujourd\'hui ?';
$this->uri = 'https://www.estcequonmetenprodaujourdhui.info/';
$this->description = 'Should we put a website in production today? (French)';
}
public $maintainer = 'ORelio';
public $name = 'Est-ce qu\'on met en prod aujourd\'hui ?';
public $uri = 'https://www.estcequonmetenprodaujourdhui.info/';
public $description = 'Should we put a website in production today? (French)';
public function collectData(){
function ExtractFromDelimiters($string, $start, $end) {

View file

@ -1,23 +1,21 @@
<?php
class FacebookBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "teromene";
public $name = "Facebook";
public $uri = "https://www.facebook.com/";
public $description = "Input a page title or a profile log. For a profile log, please insert the parameter as follow : myExamplePage/132621766841117";
$this->maintainer = "teromene";
$this->name = "Facebook";
$this->uri = "http://www.facebook.com/";
$this->description = "Input a page title or a profile log. For a profile log, please insert the parameter as follow : myExamplePage/132621766841117";
$this->parameters[] =array(
'u'=>array(
public $parameters =array( array(
'u'=>array(
'name'=>'Username',
'required'=>true
)
);
}
)
));
private $authorName='';
public function collectData(){
$param=$this->parameters[$this->queriedContext];
//Extract a string using start and end delimiters
function ExtractFromDelimiters($string, $start, $end) {
@ -33,7 +31,7 @@ class FacebookBridge extends BridgeAbstract{
if (is_array($matches) && count($matches) > 1) {
$link = $matches[1];
if (strpos($link, '/') === 0)
$link = 'https://www.facebook.com'.$link.'"';
$link = $this->uri.$link.'"';
if (strpos($link, 'facebook.com/l.php?u=') !== false)
$link = urldecode(ExtractFromDelimiters($link, 'facebook.com/l.php?u=', '&'));
return ' href="'.$link.'"';
@ -105,14 +103,12 @@ class FacebookBridge extends BridgeAbstract{
//Retrieve page contents
if (is_null($html)) {
if (isset($param['u']['value'])) {
if (!strpos($param['u']['value'], "/")) {
$html = $this->getSimpleHTMLDOM('https://www.facebook.com/'.urlencode($param['u']['value']).'?_fb_noscript=1') or $this->returnServerError('No results for this query.');
} else {
$html = $this->getSimpleHTMLDOM('https://www.facebook.com/pages/'.$param['u']['value'].'?_fb_noscript=1') or $this->returnServerError('No results for this query.');
}
if (!strpos($this->getInput('u'), "/")) {
$html = $this->getSimpleHTMLDOM($this->uri.urlencode($this->getInput('u')).'?_fb_noscript=1')
or $this->returnServerError('No results for this query.');
} else {
$this->returnClientError('You must specify a Facebook username.');
$html = $this->getSimpleHTMLDOM($this->uri.'pages/'.$this->getInput('u').'?_fb_noscript=1')
or $this->returnServerError('No results for this query.');
}
}
@ -127,7 +123,7 @@ class FacebookBridge extends BridgeAbstract{
foreach ($captcha->find('input, button') as $input)
$captcha_fields[$input->name] = $input->value;
$_SESSION['captcha_fields'] = $captcha_fields;
$_SESSION['captcha_action'] = 'https://www.facebook.com'.$captcha->find('form', 0)->action;
$_SESSION['captcha_action'] = $this->uri.$captcha->find('form', 0)->action;
//Show captcha filling form to the viewer, proxying the captcha image
$img = base64_encode($this->getContents($captcha->find('img', 0)->src));
@ -149,8 +145,8 @@ class FacebookBridge extends BridgeAbstract{
if(isset($element)) {
$author = str_replace(' | Facebook', '', $html->find('title#pageTitle', 0)->innertext);
$profilePic = 'https://graph.facebook.com/'.$param['u']['value'].'/picture?width=200&amp;height=200';
$this->name = $author;
$profilePic = 'https://graph.facebook.com/'.$this->getInput('u').'/picture?width=200&amp;height=200';
$this->authorName = $author;
foreach($element->children() as $post) {
@ -196,7 +192,7 @@ 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['uri'] = $this->uri.$post->find('abbr')[0]->parent()->getAttribute('href');
$item['content'] = $content;
$item['title'] = $title;
$item['author'] = $author;
@ -207,14 +203,8 @@ class FacebookBridge extends BridgeAbstract{
}
}
public function setDatas(array $param){
if (isset($param['captcha_response']['value']))
unset($param['captcha_response']['value']);
parent::setDatas($param);
}
public function getName() {
return (isset($this->name) ? $this->name.' - ' : '').'Facebook Bridge';
return (isset($this->authorName) ? $this->authorName.' - ' : '').'Facebook Bridge';
}
public function getCacheDuration() {

View file

@ -1,14 +1,10 @@
<?php
Class FierPandaBridge extends BridgeAbstract{
class FierPandaBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = "snroki";
$this->name = "Fier Panda Bridge";
$this->uri = "http://www.fier-panda.fr/";
$this->description = "Returns latest articles from Fier Panda.";
}
public $maintainer = "snroki";
public $name = "Fier Panda Bridge";
public $uri = "http://www.fier-panda.fr/";
public $description = "Returns latest articles from Fier Panda.";
public function collectData(){
$link = 'http://www.fier-panda.fr/';

View file

@ -1,14 +1,10 @@
<?php
class FlickrExploreBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "sebsauvage";
$this->name = "Flickr Explore";
$this->uri = "https://www.flickr.com/explore";
$this->description = "Returns the latest interesting images from Flickr";
}
public $maintainer = "sebsauvage";
public $name = "Flickr Explore";
public $uri = "https://www.flickr.com/explore";
public $description = "Returns the latest interesting images from Flickr";
public function collectData(){
$html = $this->getSimpleHTMLDOM('https://www.flickr.com/explore') or $this->returnServerError('Could not request Flickr.');

View file

@ -1,31 +1,29 @@
<?php
class FlickrTagBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "erwang";
public $name = "Flickr TagUser";
public $uri = "http://www.flickr.com/";
public $description = "Returns the tagged or user images from Flickr";
$this->maintainer = "erwang";
$this->name = "Flickr TagUser";
$this->uri = "http://www.flickr.com/";
$this->description = "Returns the tagged or user images from Flickr";
public $parameters = array(
'By keyword' => array(
'q'=>array('name'=>'keyword')
),
$this->parameters["By keyword"] = array(
'q'=>array('name'=>'keyword')
);
$this->parameters["By username"] = array(
'u'=>array('name'=>'Username')
);
}
'By username' => array(
'u'=>array('name'=>'Username')
),
);
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/search/?q=vendee&s=rec') or $this->returnServerError('Could not request Flickr.');
if (isset($param['q']['value'])) { /* keyword search mode */
$this->request = $param['q']['value'];
if (isset($this->getInput('q'))) { /* keyword search mode */
$this->request = $this->getInput('q');
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/search/?q='.urlencode($this->request).'&s=rec') or $this->returnServerError('No results for this query.');
}
elseif (isset($param['u']['value'])) { /* user timeline mode */
$this->request = $param['u']['value'];
elseif (isset($this->getInput('u'))) { /* user timeline mode */
$this->request = $this->getInput('u');
$html = $this->getSimpleHTMLDOM('http://www.flickr.com/photos/'.urlencode($this->request).'/') or $this->returnServerError('Requested username can\'t be found.');
}

View file

@ -1,14 +1,10 @@
<?php
class FootitoBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "superbaillot.net";
$this->name = "Footito";
$this->uri = "http://www.footito.fr/";
$this->description = "Footito";
}
public $maintainer = "superbaillot.net";
public $name = "Footito";
public $uri = "http://www.footito.fr/";
public $description = "Footito";
public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.footito.fr/') or $this->returnServerError('Could not request Footito.');

View file

@ -1,26 +1,21 @@
<?php
class FourchanBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "4chan";
$this->uri = "https://www.4chan.org/";
$this->description = "Returns posts from the specified thread";
$this->parameters[] = array(
't'=>array('name'=>'Thread URL')
);
}
public $maintainer = "mitsukarenai";
public $name = "4chan";
public $uri = "https://www.4chan.org/";
public $description = "Returns posts from the specified thread";
public $parameters = array( array(
't'=>array('name'=>'Thread URL')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
if (!isset($param['t']['value']))
if (!isset($this->getInput('t')))
$this->returnClientError('You must specify the thread URL (?t=...)');
$thread = parse_url($param['t']['value']) or $this->returnClientError('This URL seems malformed, please check it.');
$thread = parse_url($this->getInput('t')) or $this->returnClientError('This URL seems malformed, please check it.');
if($thread['host'] !== 'boards.4chan.org')
$this->returnClientError('4chan thread URL only.');

View file

@ -2,13 +2,10 @@
define("FREENEWS_RSS", 'http://feeds.feedburner.com/Freenews-Freebox?format=xml');
class FreenewsBridge extends RssExpander {
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "Freenews";
$this->uri = "http://freenews.fr";
$this->description = "Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales.";
}
public $maintainer = "mitsukarenai";
public $name = "Freenews";
public $uri = "http://freenews.fr";
public $description = "Un site d'actualité pour les freenautes (mais ne parlant pas que de la freebox). Ne rentrez pas d'id si vous voulez accéder aux actualités générales.";
public function collectData(){
parent::collectExpandableDatas(FREENEWS_RSS);

View file

@ -1,88 +1,84 @@
<?php
class FuturaSciencesBridge extends BridgeAbstract {
public function loadMetadatas() {
public $maintainer = 'ORelio';
public $name = 'Futura-Sciences Bridge';
public $uri = 'http://www.futura-sciences.com/';
public $description = 'Returns the newest articles.';
$this->maintainer = 'ORelio';
$this->name = 'Futura-Sciences Bridge';
$this->uri = 'http://www.futura-sciences.com/';
$this->description = 'Returns the newest articles.';
$this->parameters[] = array(
'feed'=> array(
public $parameters = array( array(
'feed'=> array(
'name'=>'Feed',
'type'=>'list',
'values'=>array(
'Les flux multi-magazines'=>array(
'Les dernières actualités de Futura-Sciences'=>'actualites',
'Les dernières définitions de Futura-Sciences'=>'definitions',
'Les dernières photos de Futura-Sciences'=>'photos',
'Les dernières questions - réponses de Futura-Sciences'=>'questions-reponses',
'Les derniers dossiers de Futura-Sciences'=>'dossiers'
),
'Les flux Services'=> array(
'Les cartes virtuelles de Futura-Sciences'=>'services/cartes-virtuelles',
'Les fonds d\'écran de Futura-Sciences'=>'services/fonds-ecran'
),
'Les flux Santé'=>array(
'Les dernières actualités de Futura-Santé'=>'sante/actualites',
'Les dernières définitions de Futura-Santé'=>'sante/definitions',
'Les dernières questions-réponses de Futura-Santé'=>'sante/question-reponses',
'Les derniers dossiers de Futura-Santé'=>'sante/dossiers'
),
'Les flux High-Tech'=>array(
'Les dernières actualités de Futura-High-Tech'=>'high-tech/actualites',
'Les dernières astuces de Futura-High-Tech'=>'high-tech/question-reponses',
'Les dernières définitions de Futura-High-Tech'=>'high-tech/definitions',
'Les derniers dossiers de Futura-High-Tech'=>'high-tech/dossiers'
),
'Les flux Espace'=>array(
'Les dernières actualités de Futura-Espace'=>'espace/actualites',
'Les dernières définitions de Futura-Espace'=>'espace/definitions',
'Les dernières questions-réponses de Futura-Espace'=>'espace/question-reponses',
'Les derniers dossiers de Futura-Espace'=>'espace/dossiers'
),
'Les flux Environnement'=>array(
'Les dernières actualités de Futura-Environnement'=>'environnement/actualites',
'Les dernières définitions de Futura-Environnement'=>'environnement/definitions',
'Les dernières questions-réponses de Futura-Environnement'=>'environnement/question-reponses',
'Les derniers dossiers de Futura-Environnement'=>'environnement/dossiers'
),
'Les flux Maison'=>array(
'Les dernières actualités de Futura-Maison'=>'maison/actualites',
'Les dernières astuces de Futura-Maison'=>'maison/question-reponses',
'Les dernières définitions de Futura-Maison'=>'maison/definitions',
'Les derniers dossiers de Futura-Maison'=>'maison/dossiers'
),
'Les flux Nature'=>array(
'Les dernières actualités de Futura-Nature'=>'nature/actualites',
'Les dernières définitions de Futura-Nature'=>'nature/definitions',
'Les dernières questions-réponses de Futura-Nature'=>'nature/question-reponses',
'Les derniers dossiers de Futura-Nature'=>'nature/dossiers'
),
'Les flux Terre'=>array(
'Les dernières actualités de Futura-Terre'=>'terre/actualites',
'Les dernières définitions de Futura-Terre'=>'terre/definitions',
'Les dernières questions-réponses de Futura-Terre'=>'terre/question-reponses',
'Les derniers dossiers de Futura-Terre'=>'terre/dossiers'
),
'Les flux Matière'=>array(
'Les dernières actualités de Futura-Matière'=>'matiere/actualites',
'Les dernières définitions de Futura-Matière'=>'matiere/definitions',
'Les dernières questions-réponses de Futura-Matière'=>'matiere/question-reponses',
'Les derniers dossiers de Futura-Matière'=>'matiere/dossiers'
),
'Les flux Mathématiques'=>array(
'Les dernières actualités de Futura-Mathématiques'=>'mathematiques/actualites',
'Les derniers dossiers de Futura-Mathématiques'=>'mathematiques/dossiers'
)
'Les flux multi-magazines'=>array(
'Les dernières actualités de Futura-Sciences'=>'actualites',
'Les dernières définitions de Futura-Sciences'=>'definitions',
'Les dernières photos de Futura-Sciences'=>'photos',
'Les dernières questions - réponses de Futura-Sciences'=>'questions-reponses',
'Les derniers dossiers de Futura-Sciences'=>'dossiers'
),
'Les flux Services'=> array(
'Les cartes virtuelles de Futura-Sciences'=>'services/cartes-virtuelles',
'Les fonds d\'écran de Futura-Sciences'=>'services/fonds-ecran'
),
'Les flux Santé'=>array(
'Les dernières actualités de Futura-Santé'=>'sante/actualites',
'Les dernières définitions de Futura-Santé'=>'sante/definitions',
'Les dernières questions-réponses de Futura-Santé'=>'sante/question-reponses',
'Les derniers dossiers de Futura-Santé'=>'sante/dossiers'
),
'Les flux High-Tech'=>array(
'Les dernières actualités de Futura-High-Tech'=>'high-tech/actualites',
'Les dernières astuces de Futura-High-Tech'=>'high-tech/question-reponses',
'Les dernières définitions de Futura-High-Tech'=>'high-tech/definitions',
'Les derniers dossiers de Futura-High-Tech'=>'high-tech/dossiers'
),
'Les flux Espace'=>array(
'Les dernières actualités de Futura-Espace'=>'espace/actualites',
'Les dernières définitions de Futura-Espace'=>'espace/definitions',
'Les dernières questions-réponses de Futura-Espace'=>'espace/question-reponses',
'Les derniers dossiers de Futura-Espace'=>'espace/dossiers'
),
'Les flux Environnement'=>array(
'Les dernières actualités de Futura-Environnement'=>'environnement/actualites',
'Les dernières définitions de Futura-Environnement'=>'environnement/definitions',
'Les dernières questions-réponses de Futura-Environnement'=>'environnement/question-reponses',
'Les derniers dossiers de Futura-Environnement'=>'environnement/dossiers'
),
'Les flux Maison'=>array(
'Les dernières actualités de Futura-Maison'=>'maison/actualites',
'Les dernières astuces de Futura-Maison'=>'maison/question-reponses',
'Les dernières définitions de Futura-Maison'=>'maison/definitions',
'Les derniers dossiers de Futura-Maison'=>'maison/dossiers'
),
'Les flux Nature'=>array(
'Les dernières actualités de Futura-Nature'=>'nature/actualites',
'Les dernières définitions de Futura-Nature'=>'nature/definitions',
'Les dernières questions-réponses de Futura-Nature'=>'nature/question-reponses',
'Les derniers dossiers de Futura-Nature'=>'nature/dossiers'
),
'Les flux Terre'=>array(
'Les dernières actualités de Futura-Terre'=>'terre/actualites',
'Les dernières définitions de Futura-Terre'=>'terre/definitions',
'Les dernières questions-réponses de Futura-Terre'=>'terre/question-reponses',
'Les derniers dossiers de Futura-Terre'=>'terre/dossiers'
),
'Les flux Matière'=>array(
'Les dernières actualités de Futura-Matière'=>'matiere/actualites',
'Les dernières définitions de Futura-Matière'=>'matiere/definitions',
'Les dernières questions-réponses de Futura-Matière'=>'matiere/question-reponses',
'Les derniers dossiers de Futura-Matière'=>'matiere/dossiers'
),
'Les flux Mathématiques'=>array(
'Les dernières actualités de Futura-Mathématiques'=>'mathematiques/actualites',
'Les derniers dossiers de Futura-Mathématiques'=>'mathematiques/dossiers'
)
)
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
function StripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);
@ -139,10 +135,10 @@ class FuturaSciencesBridge extends BridgeAbstract {
return '';
}
$url = $this->getURI().'rss/'.$param['feed']['value'].'.xml';
if (empty($param['feed']['value']))
$url = $this->getURI().'rss/'.$this->getInput('feed').'.xml';
if (empty($this->getInput('feed')))
$this->returnClientError('Please select a feed to display.'.$url);
if ($param['feed']['value'] !== preg_replace('/[^a-zA-Z-\/]+/', '', $param['feed']['value']) || substr_count($param['feed']['value'], '/') > 1 || strlen($param['feed']['value'] > 64))
if ($this->getInput('feed') !== preg_replace('/[^a-zA-Z-\/]+/', '', $this->getInput('feed')) || substr_count($this->getInput('feed'), '/') > 1 || strlen($this->getInput('feed') > 64))
$this->returnClientError('Invalid "feed" parameter.'.$url);
$html = $this->getSimpleHTMLDOM($url) or $this->returnServerError('Could not request Futura-Sciences: '.$url);

View file

@ -1,28 +1,24 @@
<?php
class GBAtempBridge extends BridgeAbstract {
private $filter = '';
public $maintainer = 'ORelio';
public $name = 'GBAtemp';
public $uri = 'http://gbatemp.net/';
public $description = 'GBAtemp is a user friendly underground video game community.';
public function loadMetadatas() {
$this->maintainer = 'ORelio';
$this->name = 'GBAtemp';
$this->uri = 'http://gbatemp.net/';
$this->description = 'GBAtemp is a user friendly underground video game community.';
$this->parameters[] = array(
'type'=>array(
public $parameters = array( array(
'type'=>array(
'name'=>'Type',
'type'=>'list',
'required'=>true,
'values'=>array(
'News'=>'N',
'Reviews'=>'R',
'Tutorials'=>'T',
'Forum'=>'F'
'News'=>'N',
'Reviews'=>'R',
'Tutorials'=>'T',
'Forum'=>'F'
)
)
);
}
)
));
private function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
@ -64,21 +60,11 @@ class GBAtempBridge extends BridgeAbstract {
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$typeFilter = '';
if (!empty($param['type']['value'])) {
if ($param['type']['value'] == 'N' || $param['type']['value'] == 'R' || $param['type']['value'] == 'T' || $param['type']['value'] == 'F') {
$typeFilter = $param['type']['value'];
if ($typeFilter == 'N') { $this->filter = 'News'; }
if ($typeFilter == 'R') { $this->filter = 'Review'; }
if ($typeFilter == 'T') { $this->filter = 'Tutorial'; }
if ($typeFilter == 'F') { $this->filter = 'Forum'; }
} else $this->returnClientError('The provided type filter is invalid. Expecting N, R, T, or F.');
} else $this->returnClientError('Please provide a type filter. Expecting N, R, T, or F.');
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request GBAtemp.');
if ($typeFilter == 'N') {
switch($this->getInput('type')){
case 'N':
foreach ($html->find('li[class=news_item full]') as $newsItem) {
$url = $this->uri.$newsItem->find('a', 0)->href;
$time = intval($this->ExtractFromDelimiters($newsItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"'));
@ -87,7 +73,7 @@ class GBAtempBridge extends BridgeAbstract {
$content = $this->fetch_post_content($url, $this->uri);
$this->items[] = $this->build_item($url, $title, $author, $time, $content);
}
} else if ($typeFilter == 'R') {
case 'R':
foreach ($html->find('li.portal_review') as $reviewItem) {
$url = $this->uri.$reviewItem->find('a', 0)->href;
$title = $reviewItem->find('span.review_title', 0)->plaintext;
@ -102,7 +88,7 @@ class GBAtempBridge extends BridgeAbstract {
$content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, $this->uri);
$this->items[] = $this->build_item($url, $title, $author, $time, $content);
}
} else if ($typeFilter == 'T') {
case 'T':
foreach ($html->find('li.portal-tutorial') as $tutorialItem) {
$url = $this->uri.$tutorialItem->find('a', 0)->href;
$title = $tutorialItem->find('a', 0)->plaintext;
@ -111,7 +97,7 @@ class GBAtempBridge extends BridgeAbstract {
$content = $this->fetch_post_content($url, $this->uri);
$this->items[] = $this->build_item($url, $title, $author, $time, $content);
}
} else if ($typeFilter == 'F') {
case 'F':
foreach ($html->find('li.rc_item') as $postItem) {
$url = $this->uri.$postItem->find('a', 1)->href;
$title = $postItem->find('a', 1)->plaintext;
@ -124,7 +110,8 @@ class GBAtempBridge extends BridgeAbstract {
}
public function getName() {
return 'GBAtemp'.(empty($this->filter) ? '' : ' '.$this->filter).' Bridge';
$type=array_search($this->getInput('type'),$param['type']['values']);
return 'GBAtemp '.$type.' Bridge';
}
public function getCacheDuration() {

View file

@ -4,20 +4,17 @@ define("RSS_SUFFIX", "/full");
class GawkerBridge extends RssExpander{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Gawker media";
public $uri = "http://feeds.gawker.com/";
public $description = "A bridge allowing access to any of the numerous Gawker media blogs (Lifehacker, deadspin, Kotaku, Jezebel, and so on. Notice you have to give its id to find the RSS stream in gawker maze";
$this->maintainer = "mitsukarenai";
$this->name = "Gawker media";
$this->uri = "http://feeds.gawker.com/";
$this->description = "A bridge allowing access to any of the numerous Gawker media blogs (Lifehacker, deadspin, Kotaku, Jezebel, and so on. Notice you have to give its id to find the RSS stream in gawker maze";
$this->parameters[] = array(
'site'=>array(
'name'=>'site id to put in uri between feeds.gawker.com and /full .. which is obviously not full AT ALL',
'required'=>true
)
);
}
public $parameters = array( array(
'site'=>array(
'name'=>'site id to put in uri between feeds.gawker.com and /full .. which is obviously not full AT ALL',
'required'=>true
)
));
private function toURI($name) {
@ -25,12 +22,11 @@ class GawkerBridge extends RssExpander{
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
if (empty($param['site']['value'])) {
if (empty($this->getInput('site'))) {
trigger_error("If no site is provided, nothing is gonna happen", E_USER_ERROR);
} else {
$this->name = $param['site']['value'];
$url = $this->toURI(strtolower($param['site']['value']));
$this->name = $this->getInput('site');
$url = $this->toURI(strtolower($this->getInput('site')));
}
$this->debugMessage("loading feed from ".$this->getURI());
parent::collectExpandableDatas($url);

View file

@ -1,33 +1,28 @@
<?php
class GelbooruBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Gelbooru";
public $uri = "http://gelbooru.com/";
public $description = "Returns images from given page";
$this->maintainer = "mitsukarenai";
$this->name = "Gelbooru";
$this->uri = "http://gelbooru.com/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1;
$page = $page * 63;
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://gelbooru.com/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Gelbooru.');

View file

@ -3,41 +3,36 @@ define('GIPHY_LIMIT', 10);
class GiphyBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "kraoc";
public $name = "Giphy Bridge";
public $uri = "http://giphy.com/";
public $description = "Bridge for giphy.com";
$this->maintainer = "kraoc";
$this->name = "Giphy Bridge";
$this->uri = "http://giphy.com/";
$this->description = "Bridge for giphy.com";
$this->parameters[] = array(
's'=>array('name'=>'search tag'),
'n'=>array(
'name'=>'max number of returned items',
'type'=>'number'
)
);
}
public $parameters = array( array(
's'=>array('name'=>'search tag'),
'n'=>array(
'name'=>'max number of returned items',
'type'=>'number'
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
$base_url = 'http://giphy.com';
if (isset($param['s']['value'])) { /* keyword search mode */
$html = $this->getSimpleHTMLDOM($base_url.'/search/'.urlencode($param['s']['value'].'/')) or $this->returnServerError('No results for this query.');
if (isset($this->getInput('s'))) { /* keyword search mode */
$html = $this->getSimpleHTMLDOM($base_url.'/search/'.urlencode($this->getInput('s').'/')) or $this->returnServerError('No results for this query.');
}
else {
$this->returnClientError('You must specify a search worf (?s=...).');
}
$max = GIPHY_LIMIT;
if (isset($param['n']['value'])) {
$max = (integer) $param['n']['value'];
if (isset($this->getInput('n'))) {
$max = (integer) $this->getInput('n');
}
$limit = 0;
$kw = urlencode($param['s']['value']);
$kw = urlencode($this->getInput('s'));
foreach($html->find('div.hoverable-gif') as $entry) {
if($limit < $max) {
$node = $entry->first_child();

View file

@ -1,13 +1,13 @@
<?php
class GithubIssueBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = 'Pierre Mazière';
$this->name = 'Github Issue';
$this->uri = '';
$this->description = 'Returns the issues or comments of an issue of a github project';
public $maintainer = 'Pierre Mazière';
public $name = 'Github Issue';
public $uri = '';
public $description = 'Returns the issues or comments of an issue of a github project';
$this->parameters['global']=array (
public $parameters=array(
'global'=>array (
'u'=>array(
'name'=>'User name',
'required'=>true
@ -16,25 +16,24 @@ class GithubIssueBridge extends BridgeAbstract{
'name'=>'Project name',
'required'=>true
)
);
),
$this->parameters['Project Issues']=array();
$this->parameters['Issue comments']=array(
'Project Issues'=>array(),
'Issue comments'=>array(
'i'=>array(
'name'=>'Issue number',
'type'=>'number',
'required'=>'true'
)
);
}
)
);
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$uri = 'https://github.com/'.$param['u']['value'].'/'.$param['p']['value'].'/issues/'.(isset($param['i']['value'])?$param['i']['value']:'');
$uri = 'https://github.com/'.$this->getInput('u').'/'.$this->getInput('p').'/issues/'.(isset($this->getInput('i'))?$this->getInput('i'):'');
$html = $this->getSimpleHTMLDOM($uri)
or $this->returnServerError('No results for Github Issue '.$param['i']['value'].' in project '.$param['u']['value'].'/'.$param['p']['value']);
or $this->returnServerError('No results for Github Issue '.$this->getInput('i').' in project '.$this->getInput('u').'/'.$this->getInput('p'));
if(isset($param['i']['value'])){
if(isset($this->getInput('i'))){
foreach($html->find('.js-comment-container') as $comment){
$item = array();

View file

@ -1,19 +1,12 @@
<?php
/**
* GitlabCommitsBridge
*
* @name GitlabCommits Bridge
* @description Returns the commits of a project hosted on a gitlab instance
*/
class GitlabCommitsBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = 'Pierre Mazière';
$this->name = 'Gitlab Commits';
$this->uri = '';
$this->description = 'Returns the commits of a project hosted on a gitlab instance';
public $maintainer = 'Pierre Mazière';
public $name = 'Gitlab Commits';
public $uri = '';
public $description = 'Returns the commits of a project hosted on a gitlab instance';
$this->parameters[] = array(
public $parameters = array( array(
'uri'=>array(
'name'=>'Base URI',
'defaultValue'=>'https://gitlab.com'
@ -30,33 +23,31 @@ class GitlabCommitsBridge extends BridgeAbstract{
'name'=>'Project branch',
'defaultValue'=>'master'
)
);
}
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$uri = $param['uri']['value'].'/'.$param['u']['value'].'/'.$param['p']['value'].'/commits/';
if(isset($param['b']['value'])){
$uri.=$param['b']['value'];
$uri = $this->getInput('uri').'/'.$this->getInput('u').'/'.$this->getInput('p').'/commits/';
if(isset($this->getInput('b'))){
$uri.=$this->getInput('b');
}else{
$uri.='master';
}
$html = $this->getSimpleHTMLDOM($uri)
or $this->returnServerError('No results for Gitlab Commits of project '.$param['uri']['value'].'/'.$param['u']['value'].'/'.$param['p']['value']);
or $this->returnServerError('No results for Gitlab Commits of project '.$this->getInput('uri').'/'.$this->getInput('u').'/'.$this->getInput('p'));
foreach($html->find('li.commit') as $commit){
$item = array();
$item['uri']=$param['uri']['value'];
$item['uri']=$this->getInput('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']['value'].'/'.$param['p']['value']));
$item['uri'].=substr($href,strpos($href,'/'.$this->getInput('u').'/'.$this->getInput('p')));
}
if(in_array('commit-row-message',$classes)){
$item['title']=$a->plaintext;

View file

@ -1,14 +1,10 @@
<?php
class GizmodoFRBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "polopollo";
$this->name = "GizmodoFR";
$this->uri = "http://www.gizmodo.fr/";
$this->description = "Returns the 15 newest posts from GizmodoFR (full text).";
}
public $maintainer = "polopollo";
public $name = "GizmodoFR";
public $uri = "http://www.gizmodo.fr/";
public $description = "Returns the 15 newest posts from GizmodoFR (full text).";
public function collectData(){

View file

@ -4,32 +4,29 @@ class GooglePlusPostBridge extends BridgeAbstract
protected $_title;
protected $_url;
public function loadMetadatas() {
public $maintainer = "Grummfy";
public $name = "Google Plus Post Bridge";
public $uri = "http://plus.google.com/";
public $description = "Returns user public post (without API).";
$this->maintainer = "Grummfy";
$this->name = "Google Plus Post Bridge";
$this->uri = "http://plus.google.com/";
$this->description = "Returns user public post (without API).";
$this->parameters[] = array(
'username'=>array(
'name'=>'username or Id',
'required'=>true
)
);
}
public $parameters = array( array(
'username'=>array(
'name'=>'username or Id',
'required'=>true
)
));
const GOOGLE_PLUS_BASE_URL = 'https://plus.google.com/';
public function collectData()
{
if (!isset($param['username']['value']))
$param=$this->parameters[$queriedContext];
if (!isset($this->getInput('username')))
{
$this->returnClientError('You must specify a username (?username=...).');
}
$this->request = $param['username']['value'];
$this->request = $this->getInput('username');
// get content parsed
// $html = $this->getSimpleHTMLDOM(__DIR__ . '/../posts2.html'
$html = $this->getSimpleHTMLDOM(self::GOOGLE_PLUS_BASE_URL . urlencode($this->request) . '/posts'

View file

@ -9,33 +9,24 @@
*/
class GoogleSearchBridge extends BridgeAbstract{
private $request;
public function loadMetadatas() {
public $maintainer = "sebsauvage";
public $name = "Google search";
public $uri = "https://www.google.com/";
public $description = "Returns most recent results from Google search.";
$this->maintainer = "sebsauvage";
$this->name = "Google search";
$this->uri = "https://www.google.com/";
$this->description = "Returns most recent results from Google search.";
$this->parameters[] = array(
'q'=>array('name'=>"keyword")
);
}
public $parameters = array( array(
'q'=>array(
'name'=>"keyword",
'required'=>true
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (isset($param['q']['value'])) { /* keyword search mode */
$this->request = $param['q']['value'];
$html = $this->getSimpleHTMLDOM('https://www.google.com/search?q=' . urlencode($this->request) . '&num=100&complete=0&tbs=qdr:y,sbd:1') or $this->returnServerError('No results for this query.');
}
else{
$this->returnClientError('You must specify a keyword (?q=...).');
}
$html = $this->getSimpleHTMLDOM('https://www.google.com/search?q=' . urlencode($this->getInput('q')) . '&num=100&complete=0&tbs=qdr:y,sbd:1') or $this->returnServerError('No results for this query.');
$emIsRes = $html->find('div[id=ires]',0);
if( !is_null($emIsRes) ){
@ -55,7 +46,7 @@ class GoogleSearchBridge extends BridgeAbstract{
}
public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Google search';
return $this->getInput('q') .' - Google search';
}
public function getCacheDuration(){

View file

@ -1,12 +1,10 @@
<?php
class GuruMedBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "qwertygc";
$this->name = "GuruMed";
$this->uri = "http://www.gurumed.org";
$this->description = "Returns the 5 newest posts from Gurumed (full text)";
}
public $maintainer = "qwertygc";
public $name = "GuruMed";
public $uri = "http://www.gurumed.org";
public $description = "Returns the 5 newest posts from Gurumed (full text)";
private function GurumedStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);

View file

@ -4,30 +4,27 @@ class HDWallpapersBridge extends BridgeAbstract {
private $category;
private $resolution;
public function loadMetadatas() {
$this->maintainer = "nel50n";
$this->name = "HD Wallpapers Bridge";
$this->uri = "http://www.hdwallpapers.in/";
$this->description = "Returns the latests wallpapers from HDWallpapers";
public $maintainer = "nel50n";
public $name = "HD Wallpapers Bridge";
public $uri = "http://www.hdwallpapers.in/";
public $description = "Returns the latests wallpapers from HDWallpapers";
$this->parameters[] = array(
'c'=>array('name'=>'category'),
'm'=>array('name'=>'max number of wallpapers'),
'r'=>array(
public $parameters = array( array(
'c'=>array('name'=>'category'),
'm'=>array('name'=>'max number of wallpapers'),
'r'=>array(
'name'=>'resolution',
'exampleValue'=>'1920x1200, 1680x1050,…'
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
$baseUri = 'http://www.hdwallpapers.in';
$this->category = $param['c']['value'] ?: 'latest_wallpapers'; // Latest default
$this->resolution = $param['r']['value'] ?: '1920x1200'; // Wide wallpaper default
$this->category = $this->getInput('c') ?: 'latest_wallpapers'; // Latest default
$this->resolution = $this->getInput('r') ?: '1920x1200'; // Wide wallpaper default
$category = $this->category;
if (strrpos($category, 'wallpapers') !== strlen($category)-strlen('wallpapers')) {
@ -35,7 +32,7 @@ class HDWallpapersBridge extends BridgeAbstract {
}
$num = 0;
$max = $param['m']['value'] ?: 14;
$max = $this->getInput('m') ?: 14;
$lastpage = 1;
for ($page = 1; $page <= $lastpage; $page++) {

View file

@ -1,14 +1,10 @@
<?php
class HentaiHavenBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "albirew";
$this->name = "Hentai Haven";
$this->uri = "http://hentaihaven.org/";
$this->description = "Returns releases from Hentai Haven";
}
public $maintainer = "albirew";
public $name = "Hentai Haven";
public $uri = "http://hentaihaven.org/";
public $description = "Returns releases from Hentai Haven";
public function collectData(){
$html = $this->getSimpleHTMLDOM('http://hentaihaven.org/') or $this->returnServerError('Could not request Hentai Haven.');

View file

@ -1,51 +1,39 @@
<?php
class IdenticaBridge extends BridgeAbstract{
private $request;
public $maintainer = "mitsukarenai";
public $name = "Identica Bridge";
public $uri = "https://identi.ca/";
public $description = "Returns user timelines";
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "Identica Bridge";
$this->uri = "https://identi.ca/";
$this->description = "Returns user timelines";
$this->parameters[] = array(
'u'=>array(
'name'=>'username',
'required'=>true
)
);
}
public $parameters = array( array(
'u'=>array(
'name'=>'username',
'required'=>true
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (isset($param['u']['value'])) { /* user timeline mode */
$this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('https://identi.ca/'.urlencode($this->request)) or $this->returnServerError('Requested username can\'t be found.');
}
else {
$this->returnClientError('You must specify an Identica username (?u=...).');
}
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Requested username can\'t be found.');
foreach($html->find('li.major') as $dent) {
$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']['value'] . ' | ' . $item['content'];
$item['title'] = $this->getInput('u') . ' | ' . $item['content'];
$this->items[] = $item;
}
}
public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Identica Bridge';
return $this->getInput('u') .' - Identica Bridge';
}
public function getURI(){
return 'https://identica.com';
return $this->uri.urlencode($this->getInput('u'));
}
public function getCacheDuration(){

View file

@ -1,31 +1,21 @@
<?php
class InstagramBridge extends BridgeAbstract{
private $request;
public $maintainer = "pauder";
public $name = "Instagram Bridge";
public $uri = "http://instagram.com/";
public $description = "Returns the newest images";
public function loadMetadatas() {
$this->maintainer = "pauder";
$this->name = "Instagram Bridge";
$this->uri = "http://instagram.com/";
$this->description = "Returns the newest images";
$this->parameters[] = array(
'u'=>array('name'=>'username')
);
}
public $parameters = array( array(
'u'=>array(
'name'=>'username',
'required'=>true
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (isset($param['u']['value'])) { /* user timeline mode */
$this->request = $param['u']['value'];
$html = $this->getSimpleHTMLDOM('http://instagram.com/'.urlencode($this->request)) or $this->returnServerError('Could not request Instagram.');
}
else {
$this->returnClientError('You must specify a Instagram username (?u=...).');
}
$html = $this->getSimpleHTMLDOM($this->getURI())
or $this->returnServerError('Could not request Instagram.');
$innertext = null;
@ -71,6 +61,11 @@ class InstagramBridge extends BridgeAbstract{
}
public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Instagram Bridge';
return $this->param['u']['value'] .' - Instagram Bridge';
}
public function getURI(){
return $this->uri.urlencode($this->getInput('u'));
}
}

View file

@ -1,112 +1,111 @@
<?php
class IsoHuntBridge extends BridgeAbstract{
public function loadMetadatas(){
$this->maintainer = 'logmanoriginal';
$this->name = 'isoHunt Bridge'; // Is replaced later!
$this->uri = 'https://isohunt.to'; // Is replaced later!
$this->description = 'Returns the latest results by category or search result';
public $maintainer = 'logmanoriginal';
public $name = 'isoHunt Bridge'; // Is replaced later!
public $uri = 'https://isohunt.to'; // Is replaced later!
public $description = 'Returns the latest results by category or search result';
public $parameters = array(
/*
* Get feeds for one of the "latest" categories
* Notice: The categories "News" and "Top Searches" are received from the main page
* Elements are sorted by name ascending!
*/
'By "Latest" category' => array(
'latest_category'=>array(
'name'=>'Latest category',
'type'=>'list',
'required'=>true,
'title'=>'Select your category',
'defaultValue'=>'News',
'values'=>array(
'Hot Torrents'=>'hot_torrents',
'News'=>'news',
'Releases'=>'releases',
'Torrents'=>'torrents'
)
)
),
/*
* Get feeds for one of the "latest" categories
* Notice: The categories "News" and "Top Searches" are received from the main page
* Elements are sorted by name ascending!
*/
$this->parameters['By "Latest" category'] = array(
'latest_category'=>array(
'name'=>'Latest category',
'type'=>'list',
'required'=>true,
'title'=>'Select your category',
'defaultValue'=>'News',
'values'=>array(
'Hot Torrents'=>'hot_torrents',
'News'=>'news',
'Releases'=>'releases',
'Torrents'=>'torrents'
* Get feeds for one of the "torrent" categories
* Make sure to add new categories also to get_torrent_category_index($)!
* Elements are sorted by name ascending!
*/
'By "Torrent" category' => array(
'torrent_category'=>array(
'name'=>'Torrent category',
'type'=>'list',
'required'=>true,
'title'=>'Select your category',
'defaultValue'=>'Anime',
'values'=>array(
'Adult'=>'adult',
'Anime'=>'anime',
'Books'=>'books',
'Games'=>'games',
'Movies'=>'movies',
'Music'=>'music',
'Other'=>'other',
'Series & TV'=>'series_tv',
'Software'=>'software'
)
),
'torrent_popularity'=>array(
'name'=>'Sort by popularity',
'type'=>'checkbox',
'title'=>'Activate to receive results by popularity'
)
)
);
),
/*
* Get feeds for one of the "torrent" categories
* Make sure to add new categories also to get_torrent_category_index($)!
* Elements are sorted by name ascending!
*/
$this->parameters['By "Torrent" category'] = array(
'torrent_category'=>array(
'name'=>'Torrent category',
'type'=>'list',
'required'=>true,
'title'=>'Select your category',
'defaultValue'=>'Anime',
'values'=>array(
'Adult'=>'adult',
'Anime'=>'anime',
'Books'=>'books',
'Games'=>'games',
'Movies'=>'movies',
'Music'=>'music',
'Other'=>'other',
'Series & TV'=>'series_tv',
'Software'=>'software'
* Get feeds for a specific search request
*/
'Search torrent by name' => array(
'search_name'=>array(
'name'=>'Name',
'required'=>true,
'title'=>'Insert your search query',
'exampleValue'=>'Bridge'
),
'search_category'=>array(
'name'=>'Category',
'type'=>'list',
'title'=>'Select your category',
'defaultValue'=>'All',
'values'=>array(
'Adult'=>'adult',
'All'=>'all',
'Anime'=>'anime',
'Books'=>'books',
'Games'=>'games',
'Movies'=>'movies',
'Music'=>'music',
'Other'=>'other',
'Series & TV'=>'series_tv',
'Software'=>'software'
)
)
),
'torrent_popularity'=>array(
'name'=>'Sort by popularity',
'type'=>'checkbox',
'title'=>'Activate to receive results by popularity'
)
);
/*
* Get feeds for a specific search request
*/
$this->parameters['Search torrent by name'] = array(
'search_name'=>array(
'name'=>'Name',
'required'=>true,
'title'=>'Insert your search query',
'exampleValue'=>'Bridge'
),
'search_category'=>array(
'name'=>'Category',
'type'=>'list',
'title'=>'Select your category',
'defaultValue'=>'All',
'values'=>array(
'Adult'=>'adult',
'All'=>'all',
'Anime'=>'anime',
'Books'=>'books',
'Games'=>'games',
'Movies'=>'movies',
'Music'=>'music',
'Other'=>'other',
'Series & TV'=>'series_tv',
'Software'=>'software'
)
)
);
}
)
);
public function collectData(){
$params=$this->parameters[$this->queriedContext];
$request_path = '/'; // We'll request the main page by default
if(isset($params['latest_category']['value'])){ // Requesting one of the latest categories
$this->request_latest_category($params['latest_category']['value']);
} elseif(isset($params['torrent_category']['value'])){ // Requesting one of the torrent categories
if(isset($this->getInput('latest_category'))){ // Requesting one of the latest categories
$this->request_latest_category($this->getInput('latest_category'));
} elseif(isset($this->getInput('torrent_category'))){ // Requesting one of the torrent categories
$order_popularity = false;
if(isset($params['torrent_popularity']['value']))
$order_popularity = $params['torrent_popularity']['value'];
if(isset($this->getInput('torrent_popularity')))
$order_popularity = $this->getInput('torrent_popularity');
$this->request_torrent_category($params['torrent_category']['value'], $order_popularity);
} else if(isset($params['search_name']['value'])){ // Requesting search
if(isset($params['search_category']['value']))
$this->request_search($params['search_name']['value'], $params['search_category']['value']);
$this->request_torrent_category($this->getInput('torrent_category'), $order_popularity);
} else if(isset($this->getInput('search_name'))){ // Requesting search
if(isset($this->getInput('search_category')))
$this->request_search($this->getInput('search_name'), $this->getInput('search_category'));
else
$this->request_search($params['search_name']['value']);
$this->request_search($this->getInput('search_name'));
} else {
$this->returnClientError('Unknown request!');
}

View file

@ -1,25 +1,22 @@
<?php
class JapanExpoBridge extends HttpCachingBridgeAbstract {
public function loadMetadatas() {
$this->maintainer = 'Ginko';
$this->name = 'Japan Expo Actualités';
$this->uri = 'http://www.japan-expo-paris.com/fr/actualites';
$this->description = 'Returns most recent entries from Japan Expo actualités.';
$this->parameters[] = array(
'mode'=>array(
public $maintainer = 'Ginko';
public $name = 'Japan Expo Actualités';
public $uri = 'http://www.japan-expo-paris.com/fr/actualites';
public $description = 'Returns most recent entries from Japan Expo actualités.';
public $parameters = array( array(
'mode'=>array(
'name'=>'Mode',
'type'=>'list',
'values'=>array(
'Titles only'=>'light',
'Full Contents'=>'full'
'Titles only'=>'light',
'Full Contents'=>'full'
)
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
function french_pubdate_to_timestamp($date_to_parse) {
return strtotime(
@ -51,7 +48,7 @@ class JapanExpoBridge extends HttpCachingBridgeAbstract {
$link = 'http://www.japan-expo-paris.com/fr/actualites';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request JapanExpo: '.$link);
$fullcontent = (!empty($param['mode']['value']) && $param['mode']['value'] == 'full');
$fullcontent = (!empty($this->getInput('mode')) && $this->getInput('mode') == 'full');
$count = 0;
foreach ($html->find('a._tile2') as $element) {

View file

@ -1,30 +1,26 @@
<?php
class KonachanBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Konachan";
public $uri = "http://konachan.com/";
public $description = "Returns images from given page";
$this->maintainer = "mitsukarenai";
$this->name = "Konachan";
$this->uri = "http://konachan.com/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 1;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://konachan.com/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Konachan.');
$input_json = explode('Post.register(', $html);

View file

@ -1,12 +1,10 @@
<?php
class KoreusBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "pit-fgfjiudghdf";
$this->name = "Koreus";
$this->uri = "http://www.koreus.com/";
$this->description = "Returns the 5 newest posts from Koreus (full text)";
}
public $maintainer = "pit-fgfjiudghdf";
public $name = "Koreus";
public $uri = "http://www.koreus.com/";
public $description = "Returns the 5 newest posts from Koreus (full text)";
private function KoreusStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);

View file

@ -1,12 +1,12 @@
<?php
class KununuBridge extends HttpCachingBridgeAbstract {
public function loadMetadatas(){
$this->maintainer = "logmanoriginal";
$this->name = "Kununu Bridge"; /* This will be replaced later! */
$this->uri = "https://www.kununu.com"; /* This will be replaced later! */
$this->description = "Returns the latest reviews for a company and site of your choice.";
public $maintainer = "logmanoriginal";
public $name = "Kununu Bridge"; /* This will be replaced later! */
public $uri = "https://www.kununu.com"; /* This will be replaced later! */
public $description = "Returns the latest reviews for a company and site of your choice.";
$this->parameters['global'] = array(
public $parameters = array(
'global' => array(
'site'=>array(
'name'=>'Site',
'type'=>'list',
@ -27,34 +27,33 @@ class KununuBridge extends HttpCachingBridgeAbstract {
'exampleValue'=>'checked',
'title'=>'Activate to load full article'
)
);
),
$this->parameters[] = array(
array(
'company'=>array(
'name'=>'Company',
'required'=>true,
'exampleValue'=>'kununu-us',
'title'=>'Insert company name (i.e. Kununu US) or URI path (i.e. kununu-us)'
)
);
}
)
);
public function collectData(){
$params=$this->parameters[$this->queriedContext];
// Get Site
$site = strtolower(trim($params['site']['value']));
$site = strtolower(trim($this->getInput('site')));
if(!isset($site) || empty($site) || !$this->site_is_valid($site))
$this->returnClientError('You must specify a valid site (&site=...)!');
// Get Company (fixing whitespace and umlauts)
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($params['company']['value']))));
$company = $this->encode_umlauts(strtolower(str_replace(' ', '-', trim($this->getInput('company')))));
if(!isset($company) || empty($company))
$this->returnClientError('You must specify a company (&company=...)!');
$full = false; // By default we'll load only short article
if(isset($params['full']['value']))
$full = strtolower(trim($params['full']['value']));
if(isset($this->getInput('full')))
$full = strtolower(trim($this->getInput('full')));
// Get reviews section name (depends on site)
$section = '';

View file

@ -1,19 +1,9 @@
<?php
/**
* RssBridgeLWNprev
*
* @name LWNPrev Bridge
* @description Returns the articles from the previous LWN.net edition
*/
class LWNprevBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = 'Pierre Mazière';
$this->name = 'LWN Free Weekly Edition';
$this->uri = 'https://lwn.net/free/bigpage';
$this->description = 'LWN Free Weekly Edition available one week late';
}
public $maintainer = 'Pierre Mazière';
public $name = 'LWN Free Weekly Edition';
public $uri = 'https://lwn.net/free/bigpage';
public $description = 'LWN Free Weekly Edition available one week late';
private function jumpToNextTag(&$node){
while($node && $node->nodeType===XML_TEXT_NODE){

View file

@ -1,14 +1,12 @@
<?php
class LeBonCoinBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "16mhz";
public $name = "LeBonCoin";
public $uri = "http://www.leboncoin.fr";
public $description = "Returns most recent results from LeBonCoin for a region, and optionally a category and a keyword .";
$this->maintainer = "16mhz";
$this->name = "LeBonCoin";
$this->uri = "http://www.leboncoin.fr";
$this->description = "Returns most recent results from LeBonCoin for a region, and optionally a category and a keyword .";
$this->parameters[] = array(
public $parameters = array( array(
'k'=>array('name'=>'Mot Clé'),
'r'=>array(
'name'=>'Région',
@ -132,21 +130,18 @@ class LeBonCoinBridge extends BridgeAbstract{
),
'AUTRES'=>'autres'
)
)
);
}
)
)
);
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (empty($param['c']['value'])) {
$link = 'http://www.leboncoin.fr/annonces/offres/' . $param['r']['value'] . '/?f=a&th=1&q=' . urlencode($param['k']['value']);
if (empty($this->getInput('c'))) {
$link = 'http://www.leboncoin.fr/annonces/offres/' . $this->getInput('r') . '/?f=a&th=1&q=' . urlencode($this->getInput('k'));
}
else {
$link = 'http://www.leboncoin.fr/' . $param['c']['value'] . '/offres/' . $param['r']['value'] . '/?f=a&th=1&q=' . urlencode($param['k']['value']);
$link = 'http://www.leboncoin.fr/' . $this->getInput('c') . '/offres/' . $this->getInput('r') . '/?f=a&th=1&q=' . urlencode($this->getInput('k'));
}
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request LeBonCoin.');

View file

@ -1,12 +1,10 @@
<?php
class LeJournalDuGeekBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "polopollo";
$this->name = "journaldugeek.com (FR)";
$this->uri = "http://www.journaldugeek.com/";
$this->description = "Returns the 5 newest posts from LeJournalDuGeek (full text).";
}
public $maintainer = "polopollo";
public $name = "journaldugeek.com (FR)";
public $uri = "http://www.journaldugeek.com/";
public $description = "Returns the 5 newest posts from LeJournalDuGeek (full text).";
private function LeJournalDuGeekStripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);

View file

@ -1,14 +1,10 @@
<?php
class LeMondeInformatiqueBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = "ORelio";
$this->name = "Le Monde Informatique";
$this->uri = "http://www.lemondeinformatique.fr/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "ORelio";
public $name = "Le Monde Informatique";
public $uri = "http://www.lemondeinformatique.fr/";
public $description = "Returns the newest articles.";
public function collectData(){

View file

@ -4,14 +4,10 @@ define("SEXE_FEED", "http://sexes.blogs.liberation.fr/feeds/");
class Les400CulsBridge extends RssExpander{
public function loadMetadatas() {
$this->maintainer = "unknown";
$this->name = "Les 400 Culs";
$this->uri = "http://sexes.blogs.liberation.fr";
$this->description = "La planete sexe vue par Agnes Girard via rss-bridge";
}
public $maintainer = "unknown";
public $name = "Les 400 Culs";
public $uri = "http://sexes.blogs.liberation.fr";
public $description = "La planete sexe vue par Agnes Girard via rss-bridge";
public function collectData(){

View file

@ -1,14 +1,10 @@
<?php
class LesJoiesDuCodeBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "superbaillot.net";
$this->name = "Les Joies Du Code";
$this->uri = "http://lesjoiesducode.fr/";
$this->description = "LesJoiesDuCode";
}
public $maintainer = "superbaillot.net";
public $name = "Les Joies Du Code";
public $uri = "http://lesjoiesducode.fr/";
public $description = "LesJoiesDuCode";
public function collectData(){
$html = $this->getSimpleHTMLDOM('http://lesjoiesducode.fr/') or $this->returnServerError('Could not request LesJoiesDuCode.');

View file

@ -2,13 +2,10 @@
class LichessBridge extends HttpCachingBridgeAbstract
{
public function loadMetadatas()
{
$this->maintainer = 'AmauryCarrade';
$this->name = 'Lichess Blog';
$this->uri = 'http://lichess.org/blog';
$this->description = 'Returns the 5 newest posts from the Lichess blog (full text)';
}
public $maintainer = 'AmauryCarrade';
public $name = 'Lichess Blog';
public $uri = 'http://lichess.org/blog';
public $description = 'Returns the 5 newest posts from the Lichess blog (full text)';
public function collectData()
{

View file

@ -1,25 +1,21 @@
<?php
class LinkedInCompany extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "regisenguehard";
public $name = "LinkedIn Company";
public $uri = "https://www.linkedin.com/";
public $description = "Returns most recent actus from Company on LinkedIn. (https://www.linkedin.com/company/<strong style=\"font-weight:bold;\">apple</strong>)";
$this->maintainer = "regisenguehard";
$this->name = "LinkedIn Company";
$this->uri = "https://www.linkedin.com/";
$this->description = "Returns most recent actus from Company on LinkedIn. (https://www.linkedin.com/company/<strong style=\"font-weight:bold;\">apple</strong>)";
$this->parameters[] = array(
'c'=>array(
public $parameters = array( array(
'c'=>array(
'name'=>'Company name',
'required'=>true
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
$link = 'https://www.linkedin.com/company/'.$param['c']['value'];
$link = 'https://www.linkedin.com/company/'.$this->getInput('c');
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request LinkedIn.');

View file

@ -1,30 +1,26 @@
<?php
class LolibooruBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Lolibooru";
public $uri = "http://lolibooru.moe/";
public $description = "Returns images from given page and tags";
$this->maintainer = "mitsukarenai";
$this->name = "Lolibooru";
$this->uri = "http://lolibooru.moe/";
$this->description = "Returns images from given page and tags";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 1; $tags = '';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://lolibooru.moe/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Lolibooru.');
$input_json = explode('Post.register(', $html);

View file

@ -2,15 +2,14 @@
define('MANGAREADER_LIMIT', 10); // The default limit
class MangareaderBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "logmanoriginal";
public $name = "Mangareader Bridge";
public $uri = "http://www.mangareader.net";
public $description = "Returns the latest updates, popular mangas or manga updates (new chapters)";
$this->maintainer = "logmanoriginal";
$this->name = "Mangareader Bridge";
$this->uri = "http://www.mangareader.net";
$this->description = "Returns the latest updates, popular mangas or manga updates (new chapters)";
$this->parameters["Get latest updates"] = array();
$this->parameters["Get popular mangas"] = array(
public $parameters = array(
'Get latest updates' => array(),
'Get popular mangas' => array(
'category'=>array(
'name'=>'Category',
'type'=>'list',
@ -58,8 +57,8 @@ class MangareaderBridge extends BridgeAbstract{
'exampleValue'=>'All',
'title'=>'Select your category'
)
);
$this->parameters["Get manga updates"] = array(
),
'Get manga updates' => array(
'path'=>array(
'name'=>'Path',
'required'=>true,
@ -73,11 +72,10 @@ class MangareaderBridge extends BridgeAbstract{
'exampleValue'=>10,
'title'=>'Number of items to return [-1 returns all]'
)
);
}
)
);
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$this->request = '';
@ -85,21 +83,21 @@ class MangareaderBridge extends BridgeAbstract{
$path = "latest";
$limit = MANGAREADER_LIMIT;
if(isset($param['category']['value'])){ // Get popular updates
if(isset($this->getInput('category'))){ // Get popular updates
$type = "popular";
$path = "popular";
if($param['category']['value'] !== "all"){
$path .= "/" . $param['category']['value'];
if($this->getInput('category') !== "all"){
$path .= "/" . $this->getInput('category');
}
}
if(isset($param['path']['value'])){ // Get manga updates
if(isset($this->getInput('path'))){ // Get manga updates
$type = "path";
$path = $param['path']['value'];
$path = $this->getInput('path');
}
if(isset($param['limit']['value']) && $param['limit']['value'] !== ""){ // Get manga updates (optional parameter)
$limit = $param['limit']['value'];
if(isset($this->getInput('limit')) && $this->getInput('limit') !== ""){ // Get manga updates (optional parameter)
$limit = $this->getInput('limit');
}
// We'll use the DOM parser for this as it makes navigation easier

View file

@ -1,30 +1,27 @@
<?php
class MilbooruBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "Milbooru";
$this->uri = "http://sheslostcontrol.net/moe/shimmie/";
$this->description = "Returns images from given page";
public $maintainer = "mitsukarenai";
public $name = "Milbooru";
public $uri = "http://sheslostcontrol.net/moe/shimmie/";
public $description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://sheslostcontrol.net/moe/shimmie/index.php?q=/post/list/$tags/$page") or $this->returnServerError('Could not request Milbooru.');

View file

@ -1,12 +1,10 @@
<?php
class MondeDiploBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "Pitchoule";
$this->name = 'Monde Diplomatique';
$this->uri = 'http://www.monde-diplomatique.fr';
$this->description = "Returns most recent results from MondeDiplo.";
}
public $maintainer = "Pitchoule";
public $name = 'Monde Diplomatique';
public $uri = 'http://www.monde-diplomatique.fr';
public $description = "Returns most recent results from MondeDiplo.";
public function collectData(){
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request MondeDiplo. for : ' . $link);

View file

@ -1,12 +1,10 @@
<?php
class MsnMondeBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "kranack";
$this->name = 'MSN Actu Monde';
$this->uri = 'http://www.msn.com/fr-fr/actualite/monde';
$this->description = "Returns the 10 newest posts from MSN Actualités (full text)";
}
public $maintainer = "kranack";
public $name = 'MSN Actu Monde';
public $uri = 'http://www.msn.com/fr-fr/actualite/monde';
public $description = "Returns the 10 newest posts from MSN Actualités (full text)";
private function MsnMondeExtractContent($url, &$item) {
$html2 = $this->getSimpleHTMLDOM($url);

View file

@ -1,33 +1,29 @@
<?php
class MspabooruBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "mitsukarenai";
$this->name = "Mspabooru";
$this->uri = "http://mspabooru.com/";
$this->description = "Returns images from given page";
public $maintainer = "mitsukarenai";
public $name = "Mspabooru";
public $uri = "http://mspabooru.com/";
public $description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1;
$page = $page * 50;
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://mspabooru.com/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Mspabooru.');

View file

@ -1,12 +1,10 @@
<?php
class NakedSecurityBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = 'ORelio';
$this->name = 'Naked Security';
$this->uri = 'https://nakedsecurity.sophos.com/';
$this->description = 'Returns the newest articles.';
}
public $maintainer = 'ORelio';
public $name = 'Naked Security';
public $uri = 'https://nakedsecurity.sophos.com/';
public $description = 'Returns the newest articles.';
public function collectData(){

View file

@ -1,14 +1,10 @@
<?php
class NasaApodBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "corenting";
$this->name = "NASA APOD Bridge";
$this->uri = "http://apod.nasa.gov/apod/astropix.html";
$this->description = "Returns the 3 latest NASA APOD pictures and explanations";
}
public $maintainer = "corenting";
public $name = "NASA APOD Bridge";
public $uri = "http://apod.nasa.gov/apod/astropix.html";
public $description = "Returns the 3 latest NASA APOD pictures and explanations";
public function collectData(){

View file

@ -1,12 +1,10 @@
<?php
class NeuviemeArtBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = "ORelio";
$this->name = '9ème Art Bridge';
$this->uri = "http://www.9emeart.fr/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "ORelio";
public $name = '9ème Art Bridge';
public $uri = "http://www.9emeart.fr/";
public $description = "Returns the newest articles.";
public function collectData(){

View file

@ -1,12 +1,10 @@
<?php
class NextInpactBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = "qwertygc";
$this->name = "NextInpact Bridge";
$this->uri = "http://www.nextinpact.com/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "qwertygc";
public $name = "NextInpact Bridge";
public $uri = "http://www.nextinpact.com/";
public $description = "Returns the newest articles.";
private function StripCDATA($string) {
$string = str_replace('<![CDATA[', '', $string);

View file

@ -1,35 +1,31 @@
<?php
class NextgovBridge extends BridgeAbstract {
public function loadMetadatas() {
public $maintainer = 'ORelio';
public $name = 'Nextgov Bridge';
public $uri = 'https://www.nextgov.com/';
public $description = 'USA Federal technology news, best practices, and web 2.0 tools.';
$this->maintainer = 'ORelio';
$this->name = 'Nextgov Bridge';
$this->uri = 'https://www.nextgov.com/';
$this->description = 'USA Federal technology news, best practices, and web 2.0 tools.';
$this->parameters[] = array(
'category'=>array(
public $parameters = array( array(
'category'=>array(
'name'=>'Category',
'type'=>'list',
'values'=>array(
'All'=>'all',
'Technology News'=>'technology-news',
'CIO Briefing'=>'cio-briefing',
'Emerging Tech'=>'emerging-tech',
'Cloud'=>'cloud-computing',
'Cybersecurity'=>'cybersecurity',
'Mobile'=>'mobile',
'Health'=>'health',
'Defense'=>'defense',
'Big Data'=>'big-data'
'All'=>'all',
'Technology News'=>'technology-news',
'CIO Briefing'=>'cio-briefing',
'Emerging Tech'=>'emerging-tech',
'Cloud'=>'cloud-computing',
'Cybersecurity'=>'cybersecurity',
'Mobile'=>'mobile',
'Health'=>'health',
'Defense'=>'defense',
'Big Data'=>'big-data'
)
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) {
@ -47,7 +43,7 @@ class NextgovBridge extends BridgeAbstract {
} return $string;
}
$category = $param['category']['value'];
$category = $this->getInput('category');
if (empty($category))
$category = 'all';
if ($category !== preg_replace('/[^a-z-]+/', '', $category) || strlen($category > 32))

View file

@ -1,12 +1,10 @@
<?php
class NiceMatinBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "pit-fgfjiudghdf";
$this->name = "NiceMatin";
$this->uri = "http://www.nicematin.com/";
$this->description = "Returns the 10 newest posts from NiceMatin (full text)";
}
public $maintainer = "pit-fgfjiudghdf";
public $name = "NiceMatin";
public $uri = "http://www.nicematin.com/";
public $description = "Returns the 10 newest posts from NiceMatin (full text)";
private function NiceMatinExtractContent($url) {
$html = $this->getSimpleHTMLDOM($url);

View file

@ -1,25 +1,21 @@
<?php
class NovelUpdatesBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "albirew";
$this->name = "Novel Updates";
$this->uri = "http://www.novelupdates.com/";
$this->description = "Returns releases from Novel Updates";
$this->parameters[] = array(
'n'=>array(
public $maintainer = "albirew";
public $name = "Novel Updates";
public $uri = "http://www.novelupdates.com/";
public $description = "Returns releases from Novel Updates";
public $parameters = array( array(
'n'=>array(
'name'=>'Novel URL',
'required'=>true
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
if (!isset($param['n']['value']))
if (!isset($this->getInput('n')))
$this->returnClientError('You must specify the novel URL (/series/...)');
$thread = parse_url($param['n']['value']) or $this->returnClientError('This URL seems malformed, please check it.');
$thread = parse_url($this->getInput('n')) or $this->returnClientError('This URL seems malformed, please check it.');
if($thread['host'] !== 'www.novelupdates.com')
$this->returnClientError('NovelUpdates URL only.');
if(strpos($thread['path'], 'series/') === FALSE)

View file

@ -1,14 +1,10 @@
<?php
class NumeramaBridge extends HttpCachingBridgeAbstract {
public function loadMetadatas() {
$this->maintainer = 'mitsukarenai';
$this->name = 'Numerama';
$this->uri = 'http://www.numerama.com/';
$this->description = 'Returns the 5 newest posts from Numerama (full text)';
}
public $maintainer = 'mitsukarenai';
public $name = 'Numerama';
public $uri = 'http://www.numerama.com/';
public $description = 'Returns the 5 newest posts from Numerama (full text)';
public function collectData(){

View file

@ -1,43 +1,38 @@
<?php
class OpenClassroomsBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "sebsauvage";
public $name = "OpenClassrooms Bridge";
public $uri = "https://openclassrooms.com/";
public $description = "Returns latest tutorials from OpenClassrooms.";
$this->maintainer = "sebsauvage";
$this->name = "OpenClassrooms Bridge";
$this->uri = "https://openclassrooms.com/";
$this->description = "Returns latest tutorials from OpenClassrooms.";
$this->parameters[] = array(
'u'=>array(
public $parameters = array( array(
'u'=>array(
'name'=>'Catégorie',
'type'=>'list',
'values'=>array(
'Arts & Culture'=>'arts',
'Code'=>'code',
'Design'=>'design',
'Entreprise'=>'business',
'Numérique'=>'digital',
'Sciences'=>'sciences',
'Sciences Humaines'=>'humainities',
'Systèmes d\'information'=>'it',
'Autres'=>'others'
'Arts & Culture'=>'arts',
'Code'=>'code',
'Design'=>'design',
'Entreprise'=>'business',
'Numérique'=>'digital',
'Sciences'=>'sciences',
'Sciences Humaines'=>'humainities',
'Systèmes d\'information'=>'it',
'Autres'=>'others'
)
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
if (empty($param['u']['value']))
if (empty($this->getInput('u')))
{
$this->returnServerError('Error: You must chose a category.');
}
$html = '';
$link = 'https://openclassrooms.com/courses?categories='.$param['u']['value'].'&title=&sort=updatedAt+desc';
$link = 'https://openclassrooms.com/courses?categories='.$this->getInput('u').'&title=&sort=updatedAt+desc';
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request OpenClassrooms.');

View file

@ -1,33 +1,27 @@
<?php
class ParuVenduImmoBridge extends BridgeAbstract
{
private $request = '';
public function loadMetadatas() {
$this->maintainer = "polo2ro";
$this->name = "Paru Vendu Immobilier";
$this->uri = "http://www.paruvendu.fr";
$this->description = "Returns the ads from the first page of search result.";
public $maintainer = "polo2ro";
public $name = "Paru Vendu Immobilier";
public $uri = "http://www.paruvendu.fr";
public $description = "Returns the ads from the first page of search result.";
$this->parameters[] = array(
'minarea'=>array(
public $parameters = array( array(
'minarea'=>array(
'name'=>'Minimal surface m²',
'type'=>'number'
),
'maxprice'=>array(
),
'maxprice'=>array(
'name'=>'Max price',
'type'=>'number'
),
'pa'=>array(
),
'pa'=>array(
'name'=>'Country code',
'exampleValue'=>'FR'
),
'lo'=>array('name'=>'department numbers or postal codes, comma-separated')
);
}
),
'lo'=>array('name'=>'department numbers or postal codes, comma-separated')
));
public function collectData()
{
@ -37,22 +31,20 @@ class ParuVenduImmoBridge extends BridgeAbstract
$maison = '&tbMai=1&tbVil=1&tbCha=1&tbPro=1&tbHot=1&tbMou=1&tbFer=1';
$link = $this->uri.'/immobilier/annonceimmofo/liste/listeAnnonces?tt=1'.$appartment.$maison;
if (isset($param['minarea']['value'])) {
$this->request .= ' '.$param['minarea']['value'].' m2';
$link .= '&sur0='.urlencode($param['minarea']['value']);
if (isset($this->getInput('minarea'))) {
$link .= '&sur0='.urlencode($this->getInput('minarea'));
}
if (isset($param['maxprice']['value'])) {
$link .= '&px1='.urlencode($param['maxprice']['value']);
if (isset($this->getInput('maxprice'))) {
$link .= '&px1='.urlencode($this->getInput('maxprice'));
}
if (isset($param['pa']['value'])) {
$link .= '&pa='.urlencode($param['pa']['value']);
if (isset($this->getInput('pa'))) {
$link .= '&pa='.urlencode($this->getInput('pa'));
}
if (isset($param['lo']['value'])) {
$this->request .= ' In: '.$param['lo']['value'];
$link .= '&lo='.urlencode($param['lo']['value']);
if (isset($this->getInput('lo'))) {
$link .= '&lo='.urlencode($this->getInput('lo'));
}
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request paruvendu.');
@ -88,7 +80,17 @@ class ParuVenduImmoBridge extends BridgeAbstract
}
public function getName(){
return 'Paru Vendu Immobilier'.$this->request;
$request='';
if(isset($this->getInput('minarea')) &&
!empty($this->getInput('minarea'))
){
$request .= ' '.$this->getInput('minarea').' m2';
}
if(isset($this->getInput('lo')) &&
!empty($this->getInput('lo'))){
$request .= ' In: '.$this->getInput('lo');
}
return 'Paru Vendu Immobilier'.$request;
}
public function getCacheDuration(){

View file

@ -5,43 +5,39 @@ class PickyWallpapersBridge extends BridgeAbstract {
private $subcategory;
private $resolution;
public function loadMetadatas() {
public $maintainer = "nel50n";
public $name = "PickyWallpapers Bridge";
public $uri = "http://www.pickywallpapers.com/";
public $description = "Returns the latests wallpapers from PickyWallpapers";
$this->maintainer = "nel50n";
$this->name = "PickyWallpapers Bridge";
$this->uri = "http://www.pickywallpapers.com/";
$this->description = "Returns the latests wallpapers from PickyWallpapers";
$this->parameters[] = array(
'c'=>array('name'=>'category'),
's'=>array('name'=>'subcategory'),
'm'=>array(
public $parameters = array( array(
'c'=>array('name'=>'category'),
's'=>array('name'=>'subcategory'),
'm'=>array(
'name'=>'Max number of wallpapers',
'type'=>'number'
),
'r'=>array(
),
'r'=>array(
'name'=>'resolution',
'exampleValue'=>'1920x1200, 1680x1050,…',
'pattern'=>'[0-9]{3,4}x[0-9]{3,4}'
)
);
)
));
}
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (!isset($param['c']['value'])) {
if (!isset($this->getInput('c'))) {
$this->returnClientError('You must specify at least a category (?c=...).');
} else {
$baseUri = 'http://www.pickywallpapers.com';
$this->category = $param['c']['value'];
$this->subcategory = $param['s']['value'] ?: '';
$this->resolution = $param['r']['value'] ?: '1920x1200'; // Wide wallpaper default
$this->category = $this->getInput('c');
$this->subcategory = $this->getInput('s') ?: '';
$this->resolution = $this->getInput('r') ?: '1920x1200'; // Wide wallpaper default
$num = 0;
$max = $param['m']['value'] ?: 12;
$max = $this->getInput('m') ?: 12;
$lastpage = 1;
for ($page = 1; $page <= $lastpage; $page++) {

View file

@ -5,45 +5,42 @@ class PinterestBridge extends BridgeAbstract{
private $board;
private $query;
public function loadMetadatas() {
public $maintainer = "pauder";
public $name = "Pinterest Bridge";
public $uri = "http://www.pinterest.com";
public $description = "Returns the newest images on a board";
$this->maintainer = "pauder";
$this->name = "Pinterest Bridge";
$this->uri = "http://www.pinterest.com";
$this->description = "Returns the newest images on a board";
$this->parameters["By username and board"] = array(
'u'=>array('name'=>'username'),
'b'=>array('name'=>'board')
);
$this->parameters["From search"] = array(
'q'=>array('name'=>'Keyword')
);
}
public $parameters = array(
'By username and board' => array(
'u'=>array('name'=>'username'),
'b'=>array('name'=>'board')
),
'From search' => array(
'q'=>array('name'=>'Keyword')
)
);
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if (isset($param['u']['value']) || isset($param['b']['value'])) {
if (isset($this->getInput('u')) || isset($this->getInput('b'))) {
if (empty($param['u']['value']))
if (empty($this->getInput('u')))
{
$this->returnClientError('You must specify a Pinterest username (?u=...).');
}
if (empty($param['b']['value']))
if (empty($this->getInput('b')))
{
$this->returnClientError('You must specify a Pinterest board for this username (?b=...).');
}
$this->username = $param['u']['value'];
$this->board = $param['b']['value'];
$this->username = $this->getInput('u');
$this->board = $this->getInput('b');
$html = $this->getSimpleHTMLDOM($this->getURI().'/'.urlencode($this->username).'/'.urlencode($this->board)) or $this->returnServerError('Username and/or board not found');
} else if (isset($param['q']['value']))
} else if (isset($this->getInput('q')))
{
$this->query = $param['q']['value'];
$this->query = $this->getInput('q');
$html = $this->getSimpleHTMLDOM($this->getURI().'/search/?q='.urlencode($this->query)) or $this->returnServerError('Could not request Pinterest.');
}

View file

@ -1,12 +1,10 @@
<?php
class PlanetLibreBridge extends BridgeAbstract{
public function loadMetadatas(){
$this->maintainer = "pit-fgfjiudghdf";
$this->name = "PlanetLibre";
$this->uri = "http://www.planet-libre.org";
$this->description = "Returns the 5 newest posts from PlanetLibre (full text)";
}
public $maintainer = "pit-fgfjiudghdf";
public $name = "PlanetLibre";
public $uri = "http://www.planet-libre.org";
public $description = "Returns the 5 newest posts from PlanetLibre (full text)";
private function PlanetLibreExtractContent($url){
$html2 = $this->getSimpleHTMLDOM($url);

View file

@ -1,14 +1,10 @@
<?php
class ProjectMGameBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "corenting";
$this->name = "Project M Game Bridge";
$this->uri = "http://projectmgame.com/en/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "corenting";
public $name = "Project M Game Bridge";
public $uri = "http://projectmgame.com/en/";
public $description = "Returns the newest articles.";
public function collectData(){

View file

@ -1,28 +1,25 @@
<?php
class RTBFBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->name = "RTBF Bridge";
$this->uri = "http://www.rtbf.be/auvio/emissions";
$this->description = "Returns the newest RTBF videos by series ID";
$this->maintainer = "Frenzie";
public $name = "RTBF Bridge";
public $uri = "http://www.rtbf.be/auvio/emissions";
public $description = "Returns the newest RTBF videos by series ID";
public $maintainer = "Frenzie";
$this->parameters[] = array(
'c'=>array(
public $parameters = array( array(
'c'=>array(
'name'=>'series id',
'exampleValue'=>9500,
'required'=>true
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
$limit = 10;
$count = 0;
if (isset($param['c']['value'])) {
$html = $this->getSimpleHTMLDOM('http://www.rtbf.be/auvio/emissions/detail?id='.$param['c']['value']) or $this->returnServerError('Could not request RTBF.');
if (isset($this->getInput('c'))) {
$html = $this->getSimpleHTMLDOM('http://www.rtbf.be/auvio/emissions/detail?id='.$this->getInput('c')) or $this->returnServerError('Could not request RTBF.');
foreach($html->find('section[id!=widget-ml-avoiraussi-] .rtbf-media-grid article') as $element) {
if($count < $limit) {

View file

@ -1,14 +1,10 @@
<?php
class Releases3DSBridge extends BridgeAbstract {
public function loadMetadatas() {
$this->maintainer = "ORelio";
$this->name = "3DS Scene Releases";
$this->uri = "http://www.3dsdb.com/";
$this->description = "Returns the newest scene releases.";
}
public $maintainer = "ORelio";
public $name = "3DS Scene Releases";
public $uri = "http://www.3dsdb.com/";
public $description = "Returns the newest scene releases.";
public function collectData(){

View file

@ -1,12 +1,10 @@
<?php
class ReporterreBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "nyutag";
$this->name = "Reporterre Bridge";
$this->uri = "http://www.reporterre.net/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "nyutag";
public $name = "Reporterre Bridge";
public $uri = "http://www.reporterre.net/";
public $description = "Returns the newest articles.";
private function ExtractContentReporterre($url) {
$html2 = $this->getSimpleHTMLDOM($url);

View file

@ -1,14 +1,10 @@
<?php
class Rue89Bridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "pit-fgfjiudghdf";
$this->name = "Rue89";
$this->uri = "http://rue89.nouvelobs.com/";
$this->description = "Returns the 5 newest posts from Rue89 (full text)";
}
public $maintainer = "pit-fgfjiudghdf";
public $name = "Rue89";
public $uri = "http://rue89.nouvelobs.com/";
public $description = "Returns the 5 newest posts from Rue89 (full text)";
private function rue89getDatas($url){

View file

@ -1,33 +1,28 @@
<?php
class Rule34Bridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Rule34";
public $uri = "http://rule34.xxx/";
public $description = "Returns images from given page";
$this->maintainer = "mitsukarenai";
$this->name = "Rule34";
$this->uri = "http://rule34.xxx/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1;
$page = $page * 50;
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://rule34.xxx/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Rule34.');

View file

@ -1,31 +1,27 @@
<?php
class Rule34pahealBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Rule34paheal";
public $uri = "http://rule34.paheal.net/";
public $description = "Returns images from given page";
$this->maintainer = "mitsukarenai";
$this->name = "Rule34paheal";
$this->uri = "http://rule34.paheal.net/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://rule34.paheal.net/post/list/$tags/$page") or $this->returnServerError('Could not request Rule34paheal.');

View file

@ -1,33 +1,28 @@
<?php
class SafebooruBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Safebooru";
public $uri = "http://safebooru.org/";
public $description = "Returns images from given page";
$this->maintainer = "mitsukarenai";
$this->name = "Safebooru";
$this->uri = "http://safebooru.org/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1;
$page = $page * 40;
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://safebooru.org/index.php?page=post&s=list&tags=$tags&pid=$page") or $this->returnServerError('Could not request Safebooru.');

View file

@ -1,31 +1,26 @@
<?php
class SakugabooruBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Sakugabooru";
public $uri = "http://sakuga.yshi.org/";
public $description = "Returns images from given page";
$this->maintainer = "mitsukarenai";
$this->name = "Sakugabooru";
$this->uri = "http://sakuga.yshi.org/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
public $parameters = array( array(
'p'=>array(
'name'=>'page',
'type'=>'number'
),
't'=>array('name'=>'tags')
);
}
),
't'=>array('name'=>'tags')
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 1;$tags='';
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']);
if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
}
if (isset($param['t']['value'])) {
$tags = urlencode($param['t']['value']);
if (isset($this->getInput('t'))) {
$tags = urlencode($this->getInput('t'));
}
$html = $this->getSimpleHTMLDOM("http://sakuga.yshi.org/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Sakugabooru.');
$input_json = explode('Post.register(', $html);

View file

@ -1,14 +1,10 @@
<?php
class ScmbBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "Astalaseven";
$this->name = "Se Coucher Moins Bête Bridge";
$this->uri = "http://secouchermoinsbete.fr/";
$this->description = "Returns the newest anecdotes.";
}
public $maintainer = "Astalaseven";
public $name = "Se Coucher Moins Bête Bridge";
public $uri = "http://secouchermoinsbete.fr/";
public $description = "Returns the newest anecdotes.";
public function collectData(){
$html = '';

View file

@ -1,27 +1,22 @@
<?php
class ScoopItBridge extends BridgeAbstract{
public function loadMetadatas() {
public $maintainer = "Pitchoule";
public $name = "ScoopIt";
public $uri = "http://www.scoop.it";
public $description = "Returns most recent results from ScoopIt.";
$this->maintainer = "Pitchoule";
$this->name = "ScoopIt";
$this->uri = "http://www.scoop.it";
$this->description = "Returns most recent results from ScoopIt.";
$this->parameters[] = array(
'u'=>array(
public $parameters = array( array(
'u'=>array(
'name'=>'keyword',
'required'=>true
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = '';
if ($param['u']['value'] != '') {
$this->request = $param['u']['value'];
if ($this->getInput('u') != '') {
$this->request = $this->getInput('u');
$link = 'http://scoop.it/search?q=' .urlencode($this->request);
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request ScoopIt. for : ' . $link);

View file

@ -1,55 +1,50 @@
<?php
class SensCritiqueBridge extends BridgeAbstract {
private $request;
public $maintainer = "kranack";
public $name = "Sens Critique";
public $uri = "http://www.senscritique.com";
public $description = "Sens Critique news";
public function loadMetadatas() {
$this->maintainer = "kranack";
$this->name = "Sens Critique";
$this->uri = "http://www.senscritique.com";
$this->description = "Sens Critique news";
$this->parameters[] = array(
'm'=>array(
public $parameters = array( array(
'm'=>array(
'name'=>'Movies',
'type'=>'checkbox'
),
's'=>array(
),
's'=>array(
'name'=>'Series',
'type'=>'checkbox'
),
'g'=>array(
),
'g'=>array(
'name'=>'Video Games',
'type'=>'checkbox'
),
'b'=>array(
),
'b'=>array(
'name'=>'Books',
'type'=>'checkbox'
),
'bd'=>array(
),
'bd'=>array(
'name'=>'BD',
'type'=>'checkbox'
),
'mu'=>array(
),
'mu'=>array(
'name'=>'Music',
'type'=>'checkbox'
)
);
}
)
));
public function collectData(){
$param=$this->parameters[$this->queriedContext];
if ((isset($param['m']['value']) && $param['m']['value'])) {
if ((isset($this->getInput('m')) && $this->getInput('m'))) {
$this->collectMoviesData();
} else if ((isset($param['s']['value']) && $param['s']['value'])) {
} else if ((isset($this->getInput('s')) && $this->getInput('s'))) {
$this->collectSeriesData();
} else if ((isset($param['g']['value']) && $param['g']['value'])) {
} else if ((isset($this->getInput('g')) && $this->getInput('g'))) {
$this->collectGamesData();
} else if ((isset($param['b']['value']) && $param['b']['value'])) {
} else if ((isset($this->getInput('b')) && $this->getInput('b'))) {
$this->collectBooksData();
} else if ((isset($param['bd']['value']) && $param['bd']['value'])) {
} else if ((isset($this->getInput('bd')) && $this->getInput('bd'))) {
$this->collectBDsData();
} else if ((isset($param['mu']['value']) && $param['mu']['value'])) {
} else if ((isset($this->getInput('mu')) && $this->getInput('mu'))) {
$this->collectMusicsData();
} else {
$this->returnClientError('You must choose a category');

View file

@ -1,14 +1,10 @@
<?php
class Sexactu extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "Riduidel";
$this->name = "Sexactu";
$this->uri = "http://www.gqmagazine.fr";
$this->description = "Sexactu via rss-bridge";
}
public $maintainer = "Riduidel";
public $name = "Sexactu";
public $uri = "http://www.gqmagazine.fr";
public $description = "Sexactu via rss-bridge";
public function collectData(){
$find = array('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'novembre', 'décembre');

Some files were not shown because too many files have changed in this diff Show more