1
0
Fork 0
forked from blallo/rss-bridge

bridges: Return parent::getName by default

This commit is contained in:
logmanoriginal 2017-02-14 22:20:55 +01:00
parent d93d491d8e
commit c4169f1579
29 changed files with 145 additions and 57 deletions

View file

@ -44,11 +44,11 @@ class AllocineFRBridge extends BridgeAbstract {
public function getName(){ public function getName(){
if(!is_null($this->getInput('category'))){ if(!is_null($this->getInput('category'))){
return self::NAME . ' : ' return self::NAME . ' : '
.array_search( .array_search(
$this->getInput('category'), $this->getInput('category'),
self::PARAMETERS[$this->queriedContext]['category']['values'] self::PARAMETERS[$this->queriedContext]['category']['values']
); );
} }
return parent::getName(); return parent::getName();

View file

@ -51,8 +51,11 @@ class AmazonBridge extends BridgeAbstract {
)); ));
public function getName(){ public function getName(){
if(!is_null($this->getInput('tld')) && !is_null($this->getInput('q'))){
return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q');
}
return 'Amazon.'.$this->getInput('tld').': '.$this->getInput('q'); return parent::getName();
} }
public function collectData() { public function collectData() {

View file

@ -57,7 +57,11 @@ class AskfmBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return self::NAME . ' : ' . $this->getInput('u'); if(!is_null($this->getInput('u'))){
return self::NAME . ' : ' . $this->getInput('u');
}
return parent::getName();
} }
public function getURI(){ public function getURI(){

View file

@ -50,6 +50,10 @@ class BandcampBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->getInput('tag') . ' - Bandcamp Tag'; if(!is_null($this->getInput('tag'))){
return $this->getInput('tag') . ' - Bandcamp Tag';
}
return parent::getName();
} }
} }

View file

@ -32,6 +32,10 @@ class BooruprojectBridge extends GelbooruBridge {
} }
public function getName(){ public function getName(){
return static::NAME . ' ' . $this->getInput('i'); if(!is_null($this->getInput('i'))){
return static::NAME . ' ' . $this->getInput('i');
}
return parent::getName();
} }
} }

View file

@ -83,7 +83,11 @@ topic found in some section URLs, else all topics are selected.';
} }
public function getName(){ public function getName(){
$topic = $this->getInput('topic'); if(!is_null($this->getInput('topic'))){
return 'CNET News Bridge' . (empty($topic) ? '' : ' - ' . $topic); $topic = $this->getInput('topic');
return 'CNET News Bridge' . (empty($topic) ? '' : ' - ' . $topic);
}
return parent::getName();
} }
} }

View file

@ -50,7 +50,11 @@ class CpasbienBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->getInput('q') . ' : ' . self::NAME; if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' : ' . self::NAME;
}
return parent::getName();
} }
private function getCachedDate($url){ private function getCachedDate($url){

View file

@ -257,6 +257,11 @@ EOD;
} }
public function getName(){ public function getName(){
return isset($this->extraInfos['name']) ? $this->extraInfos['name'] : $this->authorName . ' - Facebook Bridge'; if(!empty($this->authorName)){
return isset($this->extraInfos['name']) ? $this->extraInfos['name'] : $this->authorName
. ' - Facebook Bridge';
}
return parent::getName();
} }
} }

View file

@ -47,6 +47,7 @@ class GithubIssueBridge extends BridgeAbstract {
case 'Issue comments': case 'Issue comments':
$name = static::NAME . ' ' . $name . ' #' . $this->getInput('i'); $name = static::NAME . ' ' . $name . ' #' . $this->getInput('i');
break; break;
default: return parent::getName();
} }
return $name; return $name;
} }

View file

@ -46,6 +46,10 @@ class GoComicsBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->getInput('comicname') . ' - GoComics'; if(!is_null($this->getInput('comicname'))){
return $this->getInput('comicname') . ' - GoComics';
}
return parent::getName();
} }
} }

View file

@ -55,6 +55,10 @@ class GoogleSearchBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->getInput('q') . ' - Google search'; if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' - Google search';
}
return parent::getName();
} }
} }

View file

@ -70,10 +70,14 @@ class HDWallpapersBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return 'HDWallpapers - ' if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
. str_replace(['__', '_'], [' & ', ' '], $this->getInput('c')) return 'HDWallpapers - '
. ' [' . str_replace(['__', '_'], [' & ', ' '], $this->getInput('c'))
. $this->getInput('r') . ' ['
. ']'; . $this->getInput('r')
. ']';
}
return parent::getName();
} }
} }

View file

@ -35,7 +35,11 @@ class IdenticaBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->getInput('u') . ' - Identica Bridge'; if(!is_null($this->getInput('u'))){
return $this->getInput('u') . ' - Identica Bridge';
}
return parent::getName();
} }
public function getURI(){ public function getURI(){

View file

@ -53,7 +53,11 @@ class InstagramBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->getInput('u') . ' - Instagram Bridge'; if(!is_null($this->getInput('u'))){
return $this->getInput('u') . ' - Instagram Bridge';
}
return parent::getName();
} }
public function getURI(){ public function getURI(){

View file

@ -70,7 +70,7 @@ class KununuBridge extends BridgeAbstract {
return ($this->companyName ?: $company) . ' - ' . self::NAME; return ($this->companyName ?: $company) . ' - ' . self::NAME;
} }
return paren::getName(); return parent::getName();
} }
public function collectData(){ public function collectData(){

View file

@ -16,7 +16,11 @@ class MixCloudBridge extends BridgeAbstract {
)); ));
public function getName(){ public function getName(){
return 'MixCloud - ' . $this->getInput('u'); if(!is_null($this->getInput('u'))){
return 'MixCloud - ' . $this->getInput('u');
}
return parent::getName();
} }
public function collectData(){ public function collectData(){

View file

@ -56,6 +56,10 @@ class NovelUpdatesBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!empty($this->seriesTitle)){
return $this->seriesTitle . ' - ' . static::NAME; return $this->seriesTitle . ' - ' . static::NAME;
}
return parent::getName();
} }
} }

View file

@ -84,15 +84,19 @@ class ParuVenduImmoBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
$request = ''; if(!is_null($this->getInput('minarea'))){
$minarea = $this->getInput('minarea'); $request = '';
if(!empty($minarea)){ $minarea = $this->getInput('minarea');
$request .= ' ' . $minarea . ' m2'; if(!empty($minarea)){
$request .= ' ' . $minarea . ' m2';
}
$location = $this->getInput('lo');
if(!empty($location)){
$request .= ' In: ' . $location;
}
return 'Paru Vendu Immobilier' . $request;
} }
$location = $this->getInput('lo');
if(!empty($location)){ return parent::getName();
$request .= ' In: ' . $location;
}
return 'Paru Vendu Immobilier' . $request;
} }
} }

View file

@ -82,12 +82,16 @@ class PickyWallpapersBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
$subcategory = $this->getInput('s'); if(!is_null($this->getInput('s'))){
return 'PickyWallpapers - ' $subcategory = $this->getInput('s');
. $this->getInput('c') return 'PickyWallpapers - '
. ($subcategory ? ' > ' . $subcategory : '') . $this->getInput('c')
. ' [' . ($subcategory ? ' > ' . $subcategory : '')
. $this->getInput('r') . ' ['
. ']'; . $this->getInput('r')
. ']';
}
return parent::getName();
} }
} }

View file

@ -53,6 +53,10 @@ class RTBFBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->getInput('c') .' - RTBF Bridge'; if(!is_null($this->getInput('c'))){
return $this->getInput('c') .' - RTBF Bridge';
}
return parent::getName();
} }
} }

View file

@ -55,6 +55,10 @@ class SoundCloudBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return self::NAME . ' - ' . $this->getInput('u'); if(!is_null($this->getInput('u'))){
return self::NAME . ' - ' . $this->getInput('u');
}
return parent::getName();
} }
} }

View file

@ -61,6 +61,10 @@ class SuperbWallpapersBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return self::NAME . '- ' . $this->getInput('c') . ' [' . $this->getInput('r') . ']'; if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
return self::NAME . '- ' . $this->getInput('c') . ' [' . $this->getInput('r') . ']';
}
return parent::getName();
} }
} }

View file

@ -40,6 +40,10 @@ class TagBoardBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return 'tagboard - ' . $this->getInput('u'); if(!is_null($this->getInput('u'))){
return 'tagboard - ' . $this->getInput('u');
}
return parent::getName();
} }
} }

View file

@ -81,7 +81,11 @@ class Torrent9Bridge extends BridgeAbstract {
public function getName(){ public function getName(){
return $this->getInput('q') . ' : ' . self::NAME; if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' : ' . self::NAME;
}
return parent::getName();
} }
private function getCachedDate($url){ private function getCachedDate($url){

View file

@ -46,6 +46,7 @@ class TwitterBridge extends BridgeAbstract {
$specific = '@'; $specific = '@';
$param = 'u'; $param = 'u';
break; break;
default: return parent::getName();
} }
return 'Twitter ' . $specific . $this->getInput($param); return 'Twitter ' . $specific . $this->getInput($param);
} }

View file

@ -92,12 +92,16 @@ class WallpaperStopBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
$subcategory = $this->getInput('s'); if(!is_null($this->getInput('s')) && !is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
return 'WallpaperStop - ' $subcategory = $this->getInput('s');
. $this->getInput('c') return 'WallpaperStop - '
. (!empty($subcategory) ? ' > ' . $subcategory : '') . $this->getInput('c')
. ' [' . (!empty($subcategory) ? ' > ' . $subcategory : '')
. $this->getInput('r') . ' ['
. ']'; . $this->getInput('r')
. ']';
}
return parent::getName();
} }
} }

View file

@ -56,9 +56,7 @@ class WikipediaBridge extends BridgeAbstract {
case 'dyk': case 'dyk':
$subject = WIKIPEDIA_SUBJECT_DYK; $subject = WIKIPEDIA_SUBJECT_DYK;
break; break;
default: default: return parent::getName();
$subject = WIKIPEDIA_SUBJECT_TFA;
break;
} }
switch($subject){ switch($subject){

View file

@ -38,7 +38,7 @@ class WorldOfTanksBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->title ?: self::NAME; return $this->title ?: parent::getName();
} }
public function collectData(){ public function collectData(){

View file

@ -194,6 +194,6 @@ abstract class FeedExpander extends BridgeAbstract {
} }
public function getName(){ public function getName(){
return $this->name; return $this->name ?: parent::getName();
} }
} }