Skip to content

Commit

Permalink
[core + bridges] get rid of loadMetadata
Browse files Browse the repository at this point in the history
if a bridge needs to modify some of the data that were initialized
there, ::__construct() should be used instead.

Signed-off-by: Pierre Mazière <[email protected]>
  • Loading branch information
Pierre Mazière committed Aug 28, 2016
1 parent 2301a12 commit de1b39c
Show file tree
Hide file tree
Showing 133 changed files with 1,448 additions and 1,863 deletions.
12 changes: 4 additions & 8 deletions bridges/ABCTabsBridge.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<?php
class ABCTabsBridge extends BridgeAbstract{

public function loadMetadatas() {

$this->maintainer = "kranack";
$this->name = "ABC Tabs Bridge";
$this->uri = "http://www.abc-tabs.com/";
$this->description = "Returns 22 newest tabs";

}
public $maintainer = "kranack";
public $name = "ABC Tabs Bridge";
public $uri = "http://www.abc-tabs.com/";
public $description = "Returns 22 newest tabs";

public function collectData(){
$html = '';
Expand Down
11 changes: 4 additions & 7 deletions bridges/AcrimedBridge.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php
class AcrimedBridge extends RssExpander{

public function loadMetadatas() {

$this->maintainer = "qwertygc";
$this->name = "Acrimed Bridge";
$this->uri = "http://www.acrimed.org/";
$this->description = "Returns the newest articles.";

}
public $maintainer = "qwertygc";
public $name = "Acrimed Bridge";
public $uri = "http://www.acrimed.org/";
public $description = "Returns the newest articles.";

public function collectData(){

Expand Down
25 changes: 11 additions & 14 deletions bridges/AllocineFRBridge.php
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
<?php
class AllocineFRBridge extends BridgeAbstract{

public function loadMetadatas() {

$this->maintainer = "superbaillot.net";
$this->name = "Allo Cine Bridge";
$this->uri = "http://www.allocine.fr";
$this->description = "Bridge for allocine.fr";

$this->parameters[] = array(
'category'=>array(
public $maintainer = "superbaillot.net";
public $name = "Allo Cine Bridge";
public $uri = "http://www.allocine.fr";
public $description = "Bridge for allocine.fr";
public $parameters = array( array(
'category'=>array(
'name'=>'category',
'type'=>'list',
'required'=>true,
'exampleValue'=>'Faux Raccord',
'title'=>'Select your category',
'values'=>array(
'Faux Raccord'=>'faux-raccord',
'Top 5'=>'top-5',
'Tueurs En Serie'=>'tuers-en-serie'
'Faux Raccord'=>'faux-raccord',
'Top 5'=>'top-5',
'Tueurs En Serie'=>'tuers-en-serie'
)
)
);
}
)
));

public function collectData(){
$params=$this->parameters[$this->queriedContext];
Expand Down
20 changes: 8 additions & 12 deletions bridges/AnimeUltimeBridge.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
<?php
class AnimeUltimeBridge extends BridgeAbstract {

private $filter = 'Releases';

public function loadMetadatas() {

$this->maintainer = 'ORelio';
$this->name = 'Anime-Ultime';
$this->uri = 'http://www.anime-ultime.net/';
$this->description = 'Returns the 10 newest releases posted on Anime-Ultime';

$this->parameters[] = array(
public $maintainer = 'ORelio';
public $name = 'Anime-Ultime';
public $uri = 'http://www.anime-ultime.net/';
public $description = 'Returns the 10 newest releases posted on Anime-Ultime';
public $parameters = array( array(
'type'=>array(
'name'=>'Type',
'type'=>'list',
Expand All @@ -21,8 +16,9 @@ public function loadMetadatas() {
'Tokusatsu'=>'T'
)
)
);
}
));

private $filter = 'Releases';

public function collectData(){
$param=$this->parameters[$this->queriedContext];
Expand Down
12 changes: 4 additions & 8 deletions bridges/ArstechnicaBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@
#error_reporting(E_ALL);
class ArstechnicaBridge extends BridgeAbstract {

public function loadMetadatas() {

$this->maintainer = "prysme";
$this->name = "ArstechnicaBridge";
$this->uri = "http://arstechnica.com";
$this->description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion";

}
public $maintainer = "prysme";
public $name = "ArstechnicaBridge";
public $uri = "http://arstechnica.com";
public $description = "The PC enthusiast's resource. Power users and the tools they love, without computing religion";

function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {
Expand Down
82 changes: 40 additions & 42 deletions bridges/Arte7Bridge.php
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
<?php
class Arte7Bridge extends BridgeAbstract{
<?php
class Arte7Bridge extends BridgeAbstract{

public function loadMetadatas() {
public $maintainer = "mitsukarenai";
public $name = "Arte +7";
public $uri = "http://www.arte.tv/";
public $description = "Returns newest videos from ARTE +7";
public $parameters = array(
'Catégorie (Français)' => array(
'catfr'=>array(
'type'=>'list',
'name'=>'Catégorie',
'values'=>array(
'Toutes les vidéos (français)'=>'toutes-les-videos',
'Actu & société'=>'actu-société',
'Séries & fiction'=>'séries-fiction',
'Cinéma'=>'cinéma',
'Arts & spectacles classiques'=>'arts-spectacles-classiques',
'Culture pop'=>'culture-pop',
'Découverte'=>'découverte',
'Histoire'=>'histoire',
'Junior'=>'junior'

$this->maintainer = "mitsukarenai";
$this->name = "Arte +7";
$this->uri = "http://www.arte.tv/";
$this->description = "Returns newest videos from ARTE +7";
$this->parameters["Catégorie (Français)"] = array(
'catfr'=>array(
'type'=>'list',
'name'=>'Catégorie',
'values'=>array(
'Toutes les vidéos (français)'=>'toutes-les-videos',
'Actu & société'=>'actu-société',
'Séries & fiction'=>'séries-fiction',
'Cinéma'=>'cinéma',
'Arts & spectacles classiques'=>'arts-spectacles-classiques',
'Culture pop'=>'culture-pop',
'Découverte'=>'découverte',
'Histoire'=>'histoire',
'Junior'=>'junior'

)
)
);

$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'
)
)
),
'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;
Expand Down
26 changes: 12 additions & 14 deletions bridges/AskfmBridge.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?php
class AskfmBridge extends BridgeAbstract{

public function loadMetadatas() {

$this->maintainer = "az5he6ch";
$this->name = "Ask.fm Answers";
$this->uri = "http://ask.fm/";
$this->description = "Returns answers from an Ask.fm user";

$this->parameters["Ask.fm username"] = array(
'u'=>array(
'name'=>'Username',
'required'=>true
)
);
}
public $maintainer = "az5he6ch";
public $name = "Ask.fm Answers";
public $uri = "http://ask.fm/";
public $description = "Returns answers from an Ask.fm user";
public $parameters = array(
'Ask.fm username'=>array(
'u'=>array(
'name'=>'Username',
'required'=>true
)
)
);

public function collectData(){
$param=$this->parameters[$this->queriedContext];
Expand Down
20 changes: 8 additions & 12 deletions bridges/BandcampBridge.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<?php
class BandcampBridge extends BridgeAbstract{

public function loadMetadatas() {

$this->maintainer = "sebsauvage";
$this->name = "Bandcamp Tag";
$this->uri = "http://bandcamp.com/";
$this->description = "New bandcamp release by tag";

$this->parameters[] = array(
'tag'=>array(
public $maintainer = "sebsauvage";
public $name = "Bandcamp Tag";
public $uri = "http://bandcamp.com/";
public $description = "New bandcamp release by tag";
public $parameters = array( array(
'tag'=>array(
'name'=>'tag',
'type'=>'text'
)
);
}
)
));

public function collectData(){
$param=$this->parameters[$this->queriedContext];
Expand Down
10 changes: 4 additions & 6 deletions bridges/BastaBridge.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php
class BastaBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "qwertygc";
$this->name = "Bastamag Bridge";
$this->uri = "http://www.bastamag.net/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "qwertygc";
public $name = "Bastamag Bridge";
public $uri = "http://www.bastamag.net/";
public $description = "Returns the newest articles.";

public function collectData(){
// Replaces all relative image URLs by absolute URLs. Relative URLs always start with 'local/'!
Expand Down
11 changes: 4 additions & 7 deletions bridges/BlaguesDeMerdeBridge.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?php
class BlaguesDeMerdeBridge extends BridgeAbstract{

public function loadMetadatas() {
public $maintainer = "superbaillot.net";
public $name = "Blagues De Merde";
public $uri = "http://www.blaguesdemerde.fr/";
public $description = "Blagues De Merde";

$this->maintainer = "superbaillot.net";
$this->name = "Blagues De Merde";
$this->uri = "http://www.blaguesdemerde.fr/";
$this->description = "Blagues De Merde";

}

public function collectData(){
$html = $this->getSimpleHTMLDOM('http://www.blaguesdemerde.fr/') or $this->returnServerError('Could not request BDM.');
Expand Down
15 changes: 6 additions & 9 deletions bridges/BooruprojectBridge.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
<?php
class BooruprojectBridge extends BridgeAbstract{

public function loadMetadatas() {

$this->maintainer = "mitsukarenai";
$this->name = "Booruproject";
$this->uri = "http://booru.org/";
$this->description = "Returns images from given page and booruproject instance (****.booru.org)";
public $maintainer = "mitsukarenai";
public $name = "Booruproject";
public $uri = "http://booru.org/";
public $description = "Returns images from given page and booruproject instance (****.booru.org)";

$this->parameters[] = array(
public $parameters = array( array(
'i'=>array(
'name'=>'instance (required)',
'required'=>true
),
'p'=>array('name'=>'page'),
't'=>array('name'=>'tags')
);
}

));

public function collectData(){
$param=$this->parameters[$this->queriedContext];
Expand Down
10 changes: 4 additions & 6 deletions bridges/CADBridge.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?php
class CADBridge extends BridgeAbstract{
public function loadMetadatas() {
$this->maintainer = "nyutag";
$this->name = "CAD Bridge";
$this->uri = "http://www.cad-comic.com/";
$this->description = "Returns the newest articles.";
}
public $maintainer = "nyutag";
public $name = "CAD Bridge";
public $uri = "http://www.cad-comic.com/";
public $description = "Returns the newest articles.";

private function CADExtractContent($url) {
$html3 = $this->getSimpleHTMLDOM($url);
Expand Down
19 changes: 8 additions & 11 deletions bridges/CNETBridge.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?php
class CNETBridge extends BridgeAbstract {

public function loadMetadatas() {

$this->maintainer = 'ORelio';
$this->name = 'CNET News';
$this->uri = 'http://www.cnet.com/';
$this->description = 'Returns the newest articles. <br /> You may specify a topic found in some section URLs, else all topics are selected.';

$this->parameters[] = array(
'topic'=>array('name'=>'Topic name')
);
}
public $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 $parameters = array( array(
'topic'=>array('name'=>'Topic name')
));

public function collectData(){
$param=$this->parameters[$this->queriedContext];
Expand Down
Loading

0 comments on commit de1b39c

Please sign in to comment.