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

@ -51,10 +51,13 @@ 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() {
$uri = 'https://www.amazon.'.$this->getInput('tld').'/'; $uri = 'https://www.amazon.'.$this->getInput('tld').'/';

View file

@ -57,9 +57,13 @@ class AskfmBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!is_null($this->getInput('u'))){
return self::NAME . ' : ' . $this->getInput('u'); return self::NAME . ' : ' . $this->getInput('u');
} }
return parent::getName();
}
public function getURI(){ public function getURI(){
return self::URI . urlencode($this->getInput('u')) . '/answers/more?page=0'; return self::URI . urlencode($this->getInput('u')) . '/answers/more?page=0';
} }

View file

@ -50,6 +50,10 @@ class BandcampBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!is_null($this->getInput('tag'))){
return $this->getInput('tag') . ' - Bandcamp 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(){
if(!is_null($this->getInput('i'))){
return static::NAME . ' ' . $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(){
if(!is_null($this->getInput('topic'))){
$topic = $this->getInput('topic'); $topic = $this->getInput('topic');
return 'CNET News Bridge' . (empty($topic) ? '' : ' - ' . $topic); return 'CNET News Bridge' . (empty($topic) ? '' : ' - ' . $topic);
} }
return parent::getName();
}
} }

View file

@ -50,9 +50,13 @@ class CpasbienBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' : ' . self::NAME; return $this->getInput('q') . ' : ' . self::NAME;
} }
return parent::getName();
}
private function getCachedDate($url){ private function getCachedDate($url){
debugMessage('getting pubdate from url ' . $url . ''); debugMessage('getting pubdate from url ' . $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(){
if(!is_null($this->getInput('comicname'))){
return $this->getInput('comicname') . ' - GoComics'; return $this->getInput('comicname') . ' - GoComics';
} }
return parent::getName();
}
} }

View file

@ -55,6 +55,10 @@ class GoogleSearchBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' - Google search'; 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(){
if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
return 'HDWallpapers - ' return 'HDWallpapers - '
. str_replace(['__', '_'], [' & ', ' '], $this->getInput('c')) . str_replace(['__', '_'], [' & ', ' '], $this->getInput('c'))
. ' [' . ' ['
. $this->getInput('r') . $this->getInput('r')
. ']'; . ']';
} }
return parent::getName();
}
} }

View file

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

View file

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

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,9 +16,13 @@ class MixCloudBridge extends BridgeAbstract {
)); ));
public function getName(){ public function getName(){
if(!is_null($this->getInput('u'))){
return 'MixCloud - ' . $this->getInput('u'); return 'MixCloud - ' . $this->getInput('u');
} }
return parent::getName();
}
public function collectData(){ public function collectData(){
$html = getSimpleHTMLDOM(self::URI . '/' . $this->getInput('u')) $html = getSimpleHTMLDOM(self::URI . '/' . $this->getInput('u'))

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,6 +84,7 @@ class ParuVenduImmoBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!is_null($this->getInput('minarea'))){
$request = ''; $request = '';
$minarea = $this->getInput('minarea'); $minarea = $this->getInput('minarea');
if(!empty($minarea)){ if(!empty($minarea)){
@ -95,4 +96,7 @@ class ParuVenduImmoBridge extends BridgeAbstract {
} }
return 'Paru Vendu Immobilier' . $request; return 'Paru Vendu Immobilier' . $request;
} }
return parent::getName();
}
} }

View file

@ -82,6 +82,7 @@ class PickyWallpapersBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!is_null($this->getInput('s'))){
$subcategory = $this->getInput('s'); $subcategory = $this->getInput('s');
return 'PickyWallpapers - ' return 'PickyWallpapers - '
. $this->getInput('c') . $this->getInput('c')
@ -90,4 +91,7 @@ class PickyWallpapersBridge extends BridgeAbstract {
. $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(){
if(!is_null($this->getInput('c'))){
return $this->getInput('c') .' - RTBF Bridge'; 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(){
if(!is_null($this->getInput('u'))){
return self::NAME . ' - ' . $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(){
if(!is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
return self::NAME . '- ' . $this->getInput('c') . ' [' . $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(){
if(!is_null($this->getInput('u'))){
return 'tagboard - ' . $this->getInput('u'); return 'tagboard - ' . $this->getInput('u');
} }
return parent::getName();
}
} }

View file

@ -81,9 +81,13 @@ class Torrent9Bridge extends BridgeAbstract {
public function getName(){ public function getName(){
if(!is_null($this->getInput('q'))){
return $this->getInput('q') . ' : ' . self::NAME; return $this->getInput('q') . ' : ' . self::NAME;
} }
return parent::getName();
}
private function getCachedDate($url){ private function getCachedDate($url){
debugMessage('getting pubdate from url ' . $url . ''); debugMessage('getting pubdate from url ' . $url . '');
// Initialize cache // Initialize cache

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,6 +92,7 @@ class WallpaperStopBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if(!is_null($this->getInput('s')) && !is_null($this->getInput('c')) && !is_null($this->getInput('r'))){
$subcategory = $this->getInput('s'); $subcategory = $this->getInput('s');
return 'WallpaperStop - ' return 'WallpaperStop - '
. $this->getInput('c') . $this->getInput('c')
@ -100,4 +101,7 @@ class WallpaperStopBridge extends BridgeAbstract {
. $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();
} }
} }