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

View file

@ -1,18 +1,15 @@
<?php <?php
class AcrimedBridge extends RssExpander{ class AcrimedBridge extends RssExpander{
public function loadMetadatas() {
$this->maintainer = "qwertygc"; public $maintainer = "qwertygc";
$this->name = "Acrimed Bridge"; public $name = "Acrimed Bridge";
$this->uri = "http://www.acrimed.org/"; public $uri = "http://www.acrimed.org/";
$this->description = "Returns the newest articles."; public $description = "Returns the newest articles.";
}
public function collectData(){ 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 <?php
class AllocineFRBridge extends BridgeAbstract{ class AllocineFRBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "superbaillot.net"; public $maintainer = "superbaillot.net";
$this->name = "Allo Cine Bridge"; public $name = "Allo Cine Bridge";
$this->uri = "http://www.allocine.fr"; public $uri = "http://www.allocine.fr";
$this->description = "Bridge for allocine.fr"; public $description = "Bridge for allocine.fr";
public $parameters = array( array(
$this->parameters[] = array( 'category'=>array(
'category'=>array(
'name'=>'category', 'name'=>'category',
'type'=>'list', 'type'=>'list',
'required'=>true, 'required'=>true,
'exampleValue'=>'Faux Raccord', 'exampleValue'=>'Faux Raccord',
'title'=>'Select your category', 'title'=>'Select your category',
'values'=>array( 'values'=>array(
'Faux Raccord'=>'faux-raccord', 'Faux Raccord'=>'faux-raccord',
'Top 5'=>'top-5', 'Top 5'=>'top-5',
'Tueurs En Serie'=>'tuers-en-serie' '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(){ public function collectData(){
$params=$this->parameters[$this->queriedContext];
// Check all parameters $html = $this->getSimpleHTMLDOM($this->getURI())
if(!isset($params['category']['value'])) or $this->returnServerError("Could not request ".$this->getURI()." !");
$this->returnClientError('You must specify a valid category (&category= )!');
$category = ''; $category=array_search(
switch($params['category']['value']){ $this->getInput('category'),
case 'faux-raccord': $this->parameters[$this->queriedContext]['category']['values']
$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!');
}
// 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) foreach($html->find('figure.media-meta-fig') as $element)
{ {

View file

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

View file

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

View file

@ -1,75 +1,73 @@
<?php <?php
class Arte7Bridge extends BridgeAbstract{ class Arte7Bridge extends BridgeAbstract{
public function loadMetadatas() { public $maintainer = "mitsukarenai";
public $name = "Arte +7";
$this->maintainer = "mitsukarenai"; public $uri = "http://www.arte.tv/";
$this->name = "Arte +7"; public $description = "Returns newest videos from ARTE +7";
$this->uri = "http://www.arte.tv/"; public $parameters = array(
$this->description = "Returns newest videos from ARTE +7"; 'Catégorie (Français)' => array(
$this->parameters["Catégorie (Français)"] = array( 'catfr'=>array(
'catfr'=>array( 'type'=>'list',
'type'=>'list', 'name'=>'Catégorie',
'name'=>'Catégorie', 'values'=>array(
'values'=>array( 'Toutes les vidéos (français)'=>'toutes-les-videos',
'Toutes les vidéos (français)'=>'toutes-les-videos', 'Actu & société'=>'actu-société',
'Actu & société'=>'actu-société', 'Séries & fiction'=>'séries-fiction',
'Séries & fiction'=>'séries-fiction', 'Cinéma'=>'cinéma',
'Cinéma'=>'cinéma', 'Arts & spectacles classiques'=>'arts-spectacles-classiques',
'Arts & spectacles classiques'=>'arts-spectacles-classiques', 'Culture pop'=>'culture-pop',
'Culture pop'=>'culture-pop', 'Découverte'=>'découverte',
'Découverte'=>'découverte', 'Histoire'=>'histoire',
'Histoire'=>'histoire', 'Junior'=>'junior'
'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(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$category='toutes-les-videos'; $lang='fr'; switch($this->queriedContext){
if (!empty($param['catfr']['value'])) case 'Catégorie (Français)':
$category=$param['catfr']['value']; $category=$this->getInput('catfr');
if (!empty($param['catde']['value'])) $lang='fr';
{ $category=$param['catde']['value']; $lang='de'; } break;
$input_json = $this->extractVideoset($category, $lang); 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) { foreach($input_json['videos'] as $element) {
$item = array(); $item = array();

View file

@ -1,35 +1,26 @@
<?php <?php
class AskfmBridge extends BridgeAbstract{ class AskfmBridge extends BridgeAbstract{
public function loadMetadatas() { public $maintainer = "az5he6ch";
public $name = "Ask.fm Answers";
$this->maintainer = "az5he6ch"; public $uri = "http://ask.fm/";
$this->name = "Ask.fm Answers"; public $description = "Returns answers from an Ask.fm user";
$this->uri = "http://ask.fm/"; public $parameters = array(
$this->description = "Returns answers from an Ask.fm user"; 'Ask.fm username'=>array(
'u'=>array(
$this->parameters["Ask.fm username"] = array( 'name'=>'Username',
'u'=>array( 'required'=>true
'name'=>'Username', )
'required'=>true )
) );
);
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext]; $html = $this->getSimpleHTMLDOM($this->getURI())
$html = ''; or $this->returnServerError('Requested username can\'t be found.');
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=...).');
}
foreach($html->find('div.streamItem-answer') as $element) { foreach($html->find('div.streamItem-answer') as $element) {
$item = array(); $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); $question = trim($element->find('h1.streamItemContent-question',0)->innertext);
$item['title'] = trim(htmlspecialchars_decode($element->find('h1.streamItemContent-question',0)->plaintext, ENT_QUOTES)); $item['title'] = trim(htmlspecialchars_decode($element->find('h1.streamItemContent-question',0)->plaintext, ENT_QUOTES));
$answer = trim($element->find('p.streamItemContent-answer',0)->innertext); $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>'; $content = '<p>' . $question . '</p><p>' . $answer . '</p><p>' . $visual . '</p>';
// Fix relative links without breaking // scheme used by YouTube stuff // 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; $item['content'] = $content;
$this->items[] = $item; $this->items[] = $item;
} }
} }
public function getName(){ public function getName(){
return empty($this->request) ? $this->name : $this->request; return $this->name.' : '.$this->getInput('u');
} }
public function getURI(){ 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(){ public function getCacheDuration(){

View file

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

View file

@ -1,19 +1,18 @@
<?php <?php
class BastaBridge extends BridgeAbstract{ class BastaBridge extends BridgeAbstract{
public function loadMetadatas() { public $maintainer = "qwertygc";
$this->maintainer = "qwertygc"; public $name = "Bastamag Bridge";
$this->name = "Bastamag Bridge"; public $uri = "http://www.bastamag.net/";
$this->uri = "http://www.bastamag.net/"; public $description = "Returns the newest articles.";
$this->description = "Returns the newest articles.";
}
public function collectData(){ public function collectData(){
// Replaces all relative image URLs by absolute URLs. Relative URLs always start with 'local/'! // Replaces all relative image URLs by absolute URLs. Relative URLs always start with 'local/'!
function ReplaceImageUrl($content){ 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; $limit = 0;
foreach($html->find('item') as $element) { foreach($html->find('item') as $element) {

View file

@ -1,17 +1,15 @@
<?php <?php
class BlaguesDeMerdeBridge extends BridgeAbstract{ 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(){ 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) { foreach($html->find('article.joke_contener') as $element) {
$item = array(); $item = array();

View file

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

View file

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

View file

@ -1,22 +1,16 @@
<?php <?php
class CNETBridge extends BridgeAbstract { 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() { public $parameters = array( array(
'topic'=>array('name'=>'Topic name')
$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 function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
function ExtractFromDelimiters($string, $start, $end) { function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) { if (strpos($string, $start) !== false) {
@ -43,10 +37,7 @@ class CNETBridge extends BridgeAbstract {
return $article_html; return $article_html;
} }
if (!empty($param['topic']['value'])) $pageUrl = $this->uri.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/');
$this->topicName = $param['topic']['value'];
$pageUrl = 'http://www.cnet.com/'.(empty($this->topicName) ? '' : 'topics/'.$this->topicName.'/');
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl); $html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
$limit = 0; $limit = 0;
@ -54,7 +45,7 @@ class CNETBridge extends BridgeAbstract {
if ($limit < 8) { if ($limit < 8) {
$article_title = trim($element->find('h2', 0)->plaintext); $article_title = trim($element->find('h2', 0)->plaintext);
$article_uri = 'http://www.cnet.com'.($element->find('a', 0)->href); $article_uri = $this->uri.($element->find('a', 0)->href);
$article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext); $article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext);
$article_author = trim($element->find('a[rel=author]', 0)->plaintext); $article_author = trim($element->find('a[rel=author]', 0)->plaintext);
@ -78,7 +69,7 @@ class CNETBridge extends BridgeAbstract {
} }
public function getName() { 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() { public function getCacheDuration() {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,43 +1,34 @@
<?php <?php
class CryptomeBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Cryptome"; 'n'=>array(
$this->uri = "http://cryptome.org/";
$this->description = "Returns the N most recent documents.";
$this->parameters[] = array(
'n'=>array(
'name'=>'number of elements', 'name'=>'number of elements',
'type'=>'number', 'type'=>'number',
'defaultValue'=>20,
'exampleValue'=>10 'exampleValue'=>10
) )
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext]; $html = $this->getSimpleHTMLDOM($this->uri)
$html = ''; or $this->returnServerError('Could not request Cryptome.');
$num = 20; if (!empty($this->getInput('n'))) { /* number of documents */
$link = 'http://cryptome.org/'; $num = min($this->getInput('n'), 20);
// 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);
} }
foreach($html->find('pre') as $element) { foreach($html->find('pre') as $element) {
for ( $i = 0; $i < $num; ++$i ) { for ( $i = 0; $i < $num; ++$i ) {
$item = array(); $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['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; $this->items[] = $item;
} }
break; break;

View file

@ -1,92 +1,117 @@
<?php <?php
class DailymotionBridge extends BridgeAbstract{ 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() { public $parameters = array (
'By username' => array(
$this->maintainer = "mitsukarenai"; 'u'=>array(
$this->name = "Dailymotion Bridge"; 'name'=>'username',
$this->uri = "https://www.dailymotion.com/"; 'required'=>true
$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
), ),
'pa'=>array(
'name'=>'Page', 'By playlist id' => array(
'type'=>'number' '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) { function getMetadata($id) {
$metadata=array(); $metadata=array();
$html2 = $this->getSimpleHTMLDOM('http://www.dailymotion.com/video/'.$id) or $this->returnServerError('Could not request Dailymotion.'); $html2 = $this->getSimpleHTMLDOM($this->uri.'video/'.$id);
$metadata['title'] = $html2->find('meta[property=og:title]', 0)->getAttribute('content'); if(!$html2){
$metadata['timestamp'] = strtotime($html2->find('meta[property=video:release_date]', 0)->getAttribute('content') ); return $metadata;
$metadata['thumbnailUri'] = $html2->find('meta[property=og:image]', 0)->getAttribute('content'); }
$metadata['uri'] = $html2->find('meta[property=og:url]', 0)->getAttribute('content');
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(){ public function collectData(){
$param=$this->parameters[$this->queriedContext]; $html = '';
$html = ''; $limit = 5;
$limit = 5; $count = 0;
$count = 0;
if (isset($param['u']['value'])) { // user timeline mode $html = $this->getSimpleHTMLDOM($this->getURI())
$this->request = $param['u']['value']; or $this->returnServerError('Could not request Dailymotion.');
$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=...)');
}
foreach($html->find('div.media a.preview_link') as $element) { foreach($html->find('div.media a.preview_link') as $element) {
if($count < $limit) { if($count < $limit) {
$item = array(); $item = array();
$item['id'] = str_replace('/video/', '', strtok($element->href, '_')); $item['id'] = str_replace('/video/', '', strtok($element->href, '_'));
$metadata = $this->getMetadata($item['id']); $metadata = $this->getMetadata($item['id']);
$item['uri'] = $metadata['uri']; if(empty($metadata)){
$item['title'] = $metadata['title']; continue;
$item['timestamp'] = $metadata['timestamp']; }
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $metadata['thumbnailUri'] . '" /></a><br><a href="' . $item['uri'] . '">' . $item['title'] . '</a>'; $item['uri'] = $metadata['uri'];
$this->items[] = $item; $item['title'] = $metadata['title'];
$count++; $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(){ public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Dailymotion Bridge'; 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 $specific.' : Dailymotion Bridge';
return 3600*3; // 3 hours }
}
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 <?php
class DanbooruBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Danbooru"; 'p'=>array(
$this->uri = "http://donmai.us/"; 'name'=>'page',
$this->description = "Returns images from given page"; 'type'=>'number'
),
$this->parameters[] = array( 't'=>array('name'=>'tags')
'p'=>array('name'=>'page'), ));
't'=>array('name'=>'tags')
);
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext]; $page = $this->getInput('p')?$this->getInput('p'):1;
$page = 1;$tags=''; $tags = urlencode($this->getInput('t'));
if (isset($param['p']['value'])) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $html = $this->getSimpleHTMLDOM($this->uri."posts?&page=$page&tags=$tags")
} or $this->returnServerError('Could not request Danbooru.');
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.');
foreach($html->find('div[id=posts] article') as $element) { foreach($html->find('div[id=posts] article') as $element) {
$item = array(); $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['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-id'));
$item['timestamp'] = time(); $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['tags'] = $element->find('img', 0)->getAttribute('alt');
$item['title'] = 'Danbooru | '.$item['postid']; $item['title'] = 'Danbooru | '.$item['postid'];
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags']; $item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,24 +1,20 @@
<?php <?php
class EZTVBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "EZTV"; 'i'=>array(
$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(
'name'=>'Show ids', 'name'=>'Show ids',
'exampleValue'=>'showID1,showID2,…', 'exampleValue'=>'showID1,showID2,…',
'required'=>true 'required'=>true
) )
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
// Make timestamp from relative released time in table // Make timestamp from relative released time in table
function makeTimestamp($relativeReleaseTime){ 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')); 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 // Loop on show ids
$showList = explode(",",$param['i']['value']); $showList = explode(",",$this->getInput('i'));
foreach($showList as $showID){ foreach($showList as $showID){
// Get show page // 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... // Loop on each element that look like an episode entry...
foreach($html->find('.forum_header_border') as $element) { foreach($html->find('.forum_header_border') as $element) {
@ -60,7 +53,7 @@ class EZTVBridge extends BridgeAbstract{
// Fill item // Fill item
$item = array(); $item = array();
$item['uri'] = 'https://eztv.ch/'.$epinfo->href; $item['uri'] = $this->uri.$epinfo->href;
$item['id'] = $item['uri']; $item['id'] = $item['uri'];
$item['timestamp'] = makeTimestamp($released->plaintext); $item['timestamp'] = makeTimestamp($released->plaintext);
$item['title'] = $epinfo->plaintext; $item['title'] = $epinfo->plaintext;

View file

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

View file

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

View file

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

View file

@ -1,23 +1,21 @@
<?php <?php
class FacebookBridge extends BridgeAbstract{ 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"; public $parameters =array( array(
$this->name = "Facebook"; 'u'=>array(
$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(
'name'=>'Username', 'name'=>'Username',
'required'=>true 'required'=>true
) )
); ));
}
private $authorName='';
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
//Extract a string using start and end delimiters //Extract a string using start and end delimiters
function ExtractFromDelimiters($string, $start, $end) { function ExtractFromDelimiters($string, $start, $end) {
@ -33,7 +31,7 @@ class FacebookBridge extends BridgeAbstract{
if (is_array($matches) && count($matches) > 1) { if (is_array($matches) && count($matches) > 1) {
$link = $matches[1]; $link = $matches[1];
if (strpos($link, '/') === 0) if (strpos($link, '/') === 0)
$link = 'https://www.facebook.com'.$link.'"'; $link = $this->uri.$link.'"';
if (strpos($link, 'facebook.com/l.php?u=') !== false) if (strpos($link, 'facebook.com/l.php?u=') !== false)
$link = urldecode(ExtractFromDelimiters($link, 'facebook.com/l.php?u=', '&')); $link = urldecode(ExtractFromDelimiters($link, 'facebook.com/l.php?u=', '&'));
return ' href="'.$link.'"'; return ' href="'.$link.'"';
@ -105,14 +103,12 @@ class FacebookBridge extends BridgeAbstract{
//Retrieve page contents //Retrieve page contents
if (is_null($html)) { if (is_null($html)) {
if (isset($param['u']['value'])) { if (!strpos($this->getInput('u'), "/")) {
if (!strpos($param['u']['value'], "/")) { $html = $this->getSimpleHTMLDOM($this->uri.urlencode($this->getInput('u')).'?_fb_noscript=1')
$html = $this->getSimpleHTMLDOM('https://www.facebook.com/'.urlencode($param['u']['value']).'?_fb_noscript=1') or $this->returnServerError('No results for this query.'); 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.');
}
} else { } 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) foreach ($captcha->find('input, button') as $input)
$captcha_fields[$input->name] = $input->value; $captcha_fields[$input->name] = $input->value;
$_SESSION['captcha_fields'] = $captcha_fields; $_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 //Show captcha filling form to the viewer, proxying the captcha image
$img = base64_encode($this->getContents($captcha->find('img', 0)->src)); $img = base64_encode($this->getContents($captcha->find('img', 0)->src));
@ -149,8 +145,8 @@ class FacebookBridge extends BridgeAbstract{
if(isset($element)) { if(isset($element)) {
$author = str_replace(' | Facebook', '', $html->find('title#pageTitle', 0)->innertext); $author = str_replace(' | Facebook', '', $html->find('title#pageTitle', 0)->innertext);
$profilePic = 'https://graph.facebook.com/'.$param['u']['value'].'/picture?width=200&amp;height=200'; $profilePic = 'https://graph.facebook.com/'.$this->getInput('u').'/picture?width=200&amp;height=200';
$this->name = $author; $this->authorName = $author;
foreach($element->children() as $post) { foreach($element->children() as $post) {
@ -196,7 +192,7 @@ class FacebookBridge extends BridgeAbstract{
$title = substr($title, 0, strpos(wordwrap($title, 64), "\n")).'...'; $title = substr($title, 0, strpos(wordwrap($title, 64), "\n")).'...';
//Build and add final item //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['content'] = $content;
$item['title'] = $title; $item['title'] = $title;
$item['author'] = $author; $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() { public function getName() {
return (isset($this->name) ? $this->name.' - ' : '').'Facebook Bridge'; return (isset($this->authorName) ? $this->authorName.' - ' : '').'Facebook Bridge';
} }
public function getCacheDuration() { public function getCacheDuration() {

View file

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

View file

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

View file

@ -1,31 +1,29 @@
<?php <?php
class FlickrTagBridge extends BridgeAbstract{ 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"; public $parameters = array(
$this->name = "Flickr TagUser"; 'By keyword' => array(
$this->uri = "http://www.flickr.com/"; 'q'=>array('name'=>'keyword')
$this->description = "Returns the tagged or user images from Flickr"; ),
$this->parameters["By keyword"] = array( 'By username' => array(
'q'=>array('name'=>'keyword') 'u'=>array('name'=>'Username')
); ),
);
$this->parameters["By username"] = array(
'u'=>array('name'=>'Username')
);
}
public function collectData(){ 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.'); $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 */ if (isset($this->getInput('q'))) { /* keyword search mode */
$this->request = $param['q']['value']; $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.'); $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 */ elseif (isset($this->getInput('u'))) { /* user timeline mode */
$this->request = $param['u']['value']; $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.'); $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 <?php
class FootitoBridge extends BridgeAbstract{ class FootitoBridge extends BridgeAbstract{
public function loadMetadatas() { public $maintainer = "superbaillot.net";
public $name = "Footito";
$this->maintainer = "superbaillot.net"; public $uri = "http://www.footito.fr/";
$this->name = "Footito"; public $description = "Footito";
$this->uri = "http://www.footito.fr/";
$this->description = "Footito";
}
public function collectData(){ public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.footito.fr/') or $this->returnServerError('Could not request Footito.'); $html = $this->getSimpleHTMLDOM('http://www.footito.fr/') or $this->returnServerError('Could not request Footito.');

View file

@ -1,26 +1,21 @@
<?php <?php
class FourchanBridge extends BridgeAbstract{ class FourchanBridge extends BridgeAbstract{
public function loadMetadatas() { public $maintainer = "mitsukarenai";
public $name = "4chan";
$this->maintainer = "mitsukarenai"; public $uri = "https://www.4chan.org/";
$this->name = "4chan"; public $description = "Returns posts from the specified thread";
$this->uri = "https://www.4chan.org/";
$this->description = "Returns posts from the specified thread";
$this->parameters[] = array(
't'=>array('name'=>'Thread URL')
);
}
public $parameters = array( array(
't'=>array('name'=>'Thread URL')
));
public function collectData(){ 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=...)'); $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') if($thread['host'] !== 'boards.4chan.org')
$this->returnClientError('4chan thread URL only.'); $this->returnClientError('4chan thread URL only.');

View file

@ -2,13 +2,10 @@
define("FREENEWS_RSS", 'http://feeds.feedburner.com/Freenews-Freebox?format=xml'); define("FREENEWS_RSS", 'http://feeds.feedburner.com/Freenews-Freebox?format=xml');
class FreenewsBridge extends RssExpander { class FreenewsBridge extends RssExpander {
public function loadMetadatas() { public $maintainer = "mitsukarenai";
public $name = "Freenews";
$this->maintainer = "mitsukarenai"; public $uri = "http://freenews.fr";
$this->name = "Freenews"; 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.";
$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 function collectData(){ public function collectData(){
parent::collectExpandableDatas(FREENEWS_RSS); parent::collectExpandableDatas(FREENEWS_RSS);

View file

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

View file

@ -1,28 +1,24 @@
<?php <?php
class GBAtempBridge extends BridgeAbstract { 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() { public $parameters = array( array(
'type'=>array(
$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(
'name'=>'Type', 'name'=>'Type',
'type'=>'list', 'type'=>'list',
'required'=>true,
'values'=>array( 'values'=>array(
'News'=>'N', 'News'=>'N',
'Reviews'=>'R', 'Reviews'=>'R',
'Tutorials'=>'T', 'Tutorials'=>'T',
'Forum'=>'F' 'Forum'=>'F'
) )
) )
); ));
}
private function ExtractFromDelimiters($string, $start, $end) { private function ExtractFromDelimiters($string, $start, $end) {
if (strpos($string, $start) !== false) { if (strpos($string, $start) !== false) {
@ -64,21 +60,11 @@ class GBAtempBridge extends BridgeAbstract {
} }
public function collectData(){ 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.'); $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) { foreach ($html->find('li[class=news_item full]') as $newsItem) {
$url = $this->uri.$newsItem->find('a', 0)->href; $url = $this->uri.$newsItem->find('a', 0)->href;
$time = intval($this->ExtractFromDelimiters($newsItem->find('abbr.DateTime', 0)->outertext, 'data-time="', '"')); $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); $content = $this->fetch_post_content($url, $this->uri);
$this->items[] = $this->build_item($url, $title, $author, $time, $content); $this->items[] = $this->build_item($url, $title, $author, $time, $content);
} }
} else if ($typeFilter == 'R') { case 'R':
foreach ($html->find('li.portal_review') as $reviewItem) { foreach ($html->find('li.portal_review') as $reviewItem) {
$url = $this->uri.$reviewItem->find('a', 0)->href; $url = $this->uri.$reviewItem->find('a', 0)->href;
$title = $reviewItem->find('span.review_title', 0)->plaintext; $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); $content = $this->cleanup_post_content($intro.$review.$subheader.$procons.$scores, $this->uri);
$this->items[] = $this->build_item($url, $title, $author, $time, $content); $this->items[] = $this->build_item($url, $title, $author, $time, $content);
} }
} else if ($typeFilter == 'T') { case 'T':
foreach ($html->find('li.portal-tutorial') as $tutorialItem) { foreach ($html->find('li.portal-tutorial') as $tutorialItem) {
$url = $this->uri.$tutorialItem->find('a', 0)->href; $url = $this->uri.$tutorialItem->find('a', 0)->href;
$title = $tutorialItem->find('a', 0)->plaintext; $title = $tutorialItem->find('a', 0)->plaintext;
@ -111,7 +97,7 @@ class GBAtempBridge extends BridgeAbstract {
$content = $this->fetch_post_content($url, $this->uri); $content = $this->fetch_post_content($url, $this->uri);
$this->items[] = $this->build_item($url, $title, $author, $time, $content); $this->items[] = $this->build_item($url, $title, $author, $time, $content);
} }
} else if ($typeFilter == 'F') { case 'F':
foreach ($html->find('li.rc_item') as $postItem) { foreach ($html->find('li.rc_item') as $postItem) {
$url = $this->uri.$postItem->find('a', 1)->href; $url = $this->uri.$postItem->find('a', 1)->href;
$title = $postItem->find('a', 1)->plaintext; $title = $postItem->find('a', 1)->plaintext;
@ -124,7 +110,8 @@ class GBAtempBridge extends BridgeAbstract {
} }
public function getName() { 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() { public function getCacheDuration() {

View file

@ -4,20 +4,17 @@ define("RSS_SUFFIX", "/full");
class GawkerBridge extends RssExpander{ 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"; public $parameters = array( array(
$this->name = "Gawker media"; 'site'=>array(
$this->uri = "http://feeds.gawker.com/"; 'name'=>'site id to put in uri between feeds.gawker.com and /full .. which is obviously not full AT ALL',
$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"; 'required'=>true
)
$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
)
);
}
private function toURI($name) { private function toURI($name) {
@ -25,12 +22,11 @@ class GawkerBridge extends RssExpander{
} }
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext]; if (empty($this->getInput('site'))) {
if (empty($param['site']['value'])) {
trigger_error("If no site is provided, nothing is gonna happen", E_USER_ERROR); trigger_error("If no site is provided, nothing is gonna happen", E_USER_ERROR);
} else { } else {
$this->name = $param['site']['value']; $this->name = $this->getInput('site');
$url = $this->toURI(strtolower($param['site']['value'])); $url = $this->toURI(strtolower($this->getInput('site')));
} }
$this->debugMessage("loading feed from ".$this->getURI()); $this->debugMessage("loading feed from ".$this->getURI());
parent::collectExpandableDatas($url); parent::collectExpandableDatas($url);

View file

@ -1,33 +1,28 @@
<?php <?php
class GelbooruBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Gelbooru"; 'p'=>array(
$this->uri = "http://gelbooru.com/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
'name'=>'page', 'name'=>'page',
'type'=>'number' 'type'=>'number'
), ),
't'=>array('name'=>'tags') 't'=>array('name'=>'tags')
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0; $page = 0;
if (isset($param['p']['value'])) { if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1; $page = $page - 1;
$page = $page * 63; $page = $page * 63;
} }
if (isset($param['t']['value'])) { if (isset($this->getInput('t'))) {
$tags = urlencode($param['t']['value']); $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.'); $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{ 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"; public $parameters = array( array(
$this->name = "Giphy Bridge"; 's'=>array('name'=>'search tag'),
$this->uri = "http://giphy.com/"; 'n'=>array(
$this->description = "Bridge for giphy.com"; 'name'=>'max number of returned items',
'type'=>'number'
$this->parameters[] = array( )
's'=>array('name'=>'search tag'), ));
'n'=>array(
'name'=>'max number of returned items',
'type'=>'number'
)
);
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = ''; $html = '';
$base_url = 'http://giphy.com'; $base_url = 'http://giphy.com';
if (isset($param['s']['value'])) { /* keyword search mode */ if (isset($this->getInput('s'))) { /* keyword search mode */
$html = $this->getSimpleHTMLDOM($base_url.'/search/'.urlencode($param['s']['value'].'/')) or $this->returnServerError('No results for this query.'); $html = $this->getSimpleHTMLDOM($base_url.'/search/'.urlencode($this->getInput('s').'/')) or $this->returnServerError('No results for this query.');
} }
else { else {
$this->returnClientError('You must specify a search worf (?s=...).'); $this->returnClientError('You must specify a search worf (?s=...).');
} }
$max = GIPHY_LIMIT; $max = GIPHY_LIMIT;
if (isset($param['n']['value'])) { if (isset($this->getInput('n'))) {
$max = (integer) $param['n']['value']; $max = (integer) $this->getInput('n');
} }
$limit = 0; $limit = 0;
$kw = urlencode($param['s']['value']); $kw = urlencode($this->getInput('s'));
foreach($html->find('div.hoverable-gif') as $entry) { foreach($html->find('div.hoverable-gif') as $entry) {
if($limit < $max) { if($limit < $max) {
$node = $entry->first_child(); $node = $entry->first_child();

View file

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

View file

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

View file

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

View file

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

View file

@ -9,33 +9,24 @@
*/ */
class GoogleSearchBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Google search"; 'q'=>array(
$this->uri = "https://www.google.com/"; 'name'=>"keyword",
$this->description = "Returns most recent results from Google search."; 'required'=>true
)
$this->parameters[] = array( ));
'q'=>array('name'=>"keyword")
);
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = ''; $html = '';
if (isset($param['q']['value'])) { /* keyword search mode */ $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.');
$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=...).');
}
$emIsRes = $html->find('div[id=ires]',0); $emIsRes = $html->find('div[id=ires]',0);
if( !is_null($emIsRes) ){ if( !is_null($emIsRes) ){
@ -55,7 +46,7 @@ class GoogleSearchBridge extends BridgeAbstract{
} }
public function getName(){ public function getName(){
return (!empty($this->request) ? $this->request .' - ' : '') .'Google search'; return $this->getInput('q') .' - Google search';
} }
public function getCacheDuration(){ public function getCacheDuration(){

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,14 +1,12 @@
<?php <?php
class LeBonCoinBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$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(
'k'=>array('name'=>'Mot Clé'), 'k'=>array('name'=>'Mot Clé'),
'r'=>array( 'r'=>array(
'name'=>'Région', 'name'=>'Région',
@ -132,21 +130,18 @@ class LeBonCoinBridge extends BridgeAbstract{
), ),
'AUTRES'=>'autres' 'AUTRES'=>'autres'
) )
) )
); )
);
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = ''; $html = '';
if (empty($param['c']['value'])) { if (empty($this->getInput('c'))) {
$link = 'http://www.leboncoin.fr/annonces/offres/' . $param['r']['value'] . '/?f=a&th=1&q=' . urlencode($param['k']['value']); $link = 'http://www.leboncoin.fr/annonces/offres/' . $this->getInput('r') . '/?f=a&th=1&q=' . urlencode($this->getInput('k'));
} }
else { 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.'); $html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request LeBonCoin.');

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,25 +1,21 @@
<?php <?php
class LinkedInCompany extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "LinkedIn Company"; 'c'=>array(
$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(
'name'=>'Company name', 'name'=>'Company name',
'required'=>true 'required'=>true
) )
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$html = ''; $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.'); $html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('Could not request LinkedIn.');

View file

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

View file

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

View file

@ -1,30 +1,27 @@
<?php <?php
class MilbooruBridge extends BridgeAbstract{ class MilbooruBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "mitsukarenai"; public $maintainer = "mitsukarenai";
$this->name = "Milbooru"; public $name = "Milbooru";
$this->uri = "http://sheslostcontrol.net/moe/shimmie/"; public $uri = "http://sheslostcontrol.net/moe/shimmie/";
$this->description = "Returns images from given page"; public $description = "Returns images from given page";
$this->parameters[] = array( public $parameters = array( array(
'p'=>array( 'p'=>array(
'name'=>'page', 'name'=>'page',
'type'=>'number' 'type'=>'number'
), ),
't'=>array('name'=>'tags') 't'=>array('name'=>'tags')
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags=''; $page = 0;$tags='';
if (isset($param['p']['value'])) { if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
} }
if (isset($param['t']['value'])) { if (isset($this->getInput('t'))) {
$tags = urlencode($param['t']['value']); $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.'); $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 <?php
class MondeDiploBridge extends BridgeAbstract{ class MondeDiploBridge extends BridgeAbstract{
public function loadMetadatas() { public $maintainer = "Pitchoule";
$this->maintainer = "Pitchoule"; public $name = 'Monde Diplomatique';
$this->name = 'Monde Diplomatique'; public $uri = 'http://www.monde-diplomatique.fr';
$this->uri = 'http://www.monde-diplomatique.fr'; public $description = "Returns most recent results from MondeDiplo.";
$this->description = "Returns most recent results from MondeDiplo.";
}
public function collectData(){ public function collectData(){
$html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request MondeDiplo. for : ' . $link); $html = $this->getSimpleHTMLDOM($this->uri) or $this->returnServerError('Could not request MondeDiplo. for : ' . $link);

View file

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

View file

@ -1,33 +1,29 @@
<?php <?php
class MspabooruBridge extends BridgeAbstract{ class MspabooruBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "mitsukarenai"; public $maintainer = "mitsukarenai";
$this->name = "Mspabooru"; public $name = "Mspabooru";
$this->uri = "http://mspabooru.com/"; public $uri = "http://mspabooru.com/";
$this->description = "Returns images from given page"; public $description = "Returns images from given page";
$this->parameters[] = array( public $parameters = array( array(
'p'=>array( 'p'=>array(
'name'=>'page', 'name'=>'page',
'type'=>'number' 'type'=>'number'
), ),
't'=>array('name'=>'tags') 't'=>array('name'=>'tags')
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags=''; $page = 0;$tags='';
if (isset($param['p']['value'])) { if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1; $page = $page - 1;
$page = $page * 50; $page = $page * 50;
} }
if (isset($param['t']['value'])) { if (isset($this->getInput('t'))) {
$tags = urlencode($param['t']['value']); $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.'); $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 <?php
class NakedSecurityBridge extends BridgeAbstract { class NakedSecurityBridge extends BridgeAbstract {
public function loadMetadatas() { public $maintainer = 'ORelio';
$this->maintainer = 'ORelio'; public $name = 'Naked Security';
$this->name = 'Naked Security'; public $uri = 'https://nakedsecurity.sophos.com/';
$this->uri = 'https://nakedsecurity.sophos.com/'; public $description = 'Returns the newest articles.';
$this->description = 'Returns the newest articles.';
}
public function collectData(){ public function collectData(){

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,33 +1,28 @@
<?php <?php
class Rule34Bridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Rule34"; 'p'=>array(
$this->uri = "http://rule34.xxx/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
'name'=>'page', 'name'=>'page',
'type'=>'number' 'type'=>'number'
), ),
't'=>array('name'=>'tags') 't'=>array('name'=>'tags')
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags=''; $page = 0;$tags='';
if (isset($param['p']['value'])) { if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1; $page = $page - 1;
$page = $page * 50; $page = $page * 50;
} }
if (isset($param['t']['value'])) { if (isset($this->getInput('t'))) {
$tags = urlencode($param['t']['value']); $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.'); $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 <?php
class Rule34pahealBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Rule34paheal"; 'p'=>array(
$this->uri = "http://rule34.paheal.net/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
'name'=>'page', 'name'=>'page',
'type'=>'number' 'type'=>'number'
), ),
't'=>array('name'=>'tags') 't'=>array('name'=>'tags')
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags=''; $page = 0;$tags='';
if (isset($param['p']['value'])) { if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
} }
if (isset($param['t']['value'])) { if (isset($this->getInput('t'))) {
$tags = urlencode($param['t']['value']); $tags = urlencode($this->getInput('t'));
} }
$html = $this->getSimpleHTMLDOM("http://rule34.paheal.net/post/list/$tags/$page") or $this->returnServerError('Could not request Rule34paheal.'); $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 <?php
class SafebooruBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Safebooru"; 'p'=>array(
$this->uri = "http://safebooru.org/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
'name'=>'page', 'name'=>'page',
'type'=>'number' 'type'=>'number'
), ),
't'=>array('name'=>'tags') 't'=>array('name'=>'tags')
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 0;$tags=''; $page = 0;$tags='';
if (isset($param['p']['value'])) { if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
$page = $page - 1; $page = $page - 1;
$page = $page * 40; $page = $page * 40;
} }
if (isset($param['t']['value'])) { if (isset($this->getInput('t'))) {
$tags = urlencode($param['t']['value']); $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.'); $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 <?php
class SakugabooruBridge extends BridgeAbstract{ 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"; public $parameters = array( array(
$this->name = "Sakugabooru"; 'p'=>array(
$this->uri = "http://sakuga.yshi.org/";
$this->description = "Returns images from given page";
$this->parameters[] = array(
'p'=>array(
'name'=>'page', 'name'=>'page',
'type'=>'number' 'type'=>'number'
), ),
't'=>array('name'=>'tags') 't'=>array('name'=>'tags')
); ));
}
public function collectData(){ public function collectData(){
$param=$this->parameters[$this->queriedContext];
$page = 1;$tags=''; $page = 1;$tags='';
if (isset($param['p']['value'])) { if (isset($this->getInput('p'))) {
$page = (int)preg_replace("/[^0-9]/",'', $param['p']['value']); $page = (int)preg_replace("/[^0-9]/",'', $this->getInput('p'));
} }
if (isset($param['t']['value'])) { if (isset($this->getInput('t'))) {
$tags = urlencode($param['t']['value']); $tags = urlencode($this->getInput('t'));
} }
$html = $this->getSimpleHTMLDOM("http://sakuga.yshi.org/post?page=$page&tags=$tags") or $this->returnServerError('Could not request Sakugabooru.'); $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); $input_json = explode('Post.register(', $html);

View file

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

View file

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

View file

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

View file

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