[OpenwhydBridge] Add new bridge (#1338)
Rename WhydBridge to OpenwhydBridge
This commit is contained in:
parent
7f35fc9f6b
commit
8161829ad5
1 changed files with 7 additions and 8 deletions
|
@ -1,9 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
class WhydBridge extends BridgeAbstract {
|
class OpenwhydBridge extends BridgeAbstract {
|
||||||
|
|
||||||
const MAINTAINER = 'kranack';
|
const MAINTAINER = 'kranack';
|
||||||
const NAME = 'Whyd Bridge';
|
const NAME = 'Openwhyd Bridge';
|
||||||
const URI = 'http://www.whyd.com/';
|
const URI = 'https://openwhyd.org';
|
||||||
const CACHE_TIMEOUT = 600; // 10min
|
const CACHE_TIMEOUT = 600; // 10min
|
||||||
const DESCRIPTION = 'Returns 10 newest music from user profile';
|
const DESCRIPTION = 'Returns 10 newest music from user profile';
|
||||||
|
|
||||||
|
@ -17,8 +17,7 @@ class WhydBridge extends BridgeAbstract {
|
||||||
private $userName = '';
|
private $userName = '';
|
||||||
|
|
||||||
public function getIcon() {
|
public function getIcon() {
|
||||||
return self::URI . 'assets/favicons/
|
return self::URI . '/images/favicon.ico';
|
||||||
32-6b62a9f14d5e1a9213090d8f00f286bba3a6022381a76390d1d0926493b12593.png?v=6';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
|
@ -26,11 +25,11 @@ class WhydBridge extends BridgeAbstract {
|
||||||
if(strlen(preg_replace('/[^0-9a-f]/', '', $this->getInput('u'))) == 24) {
|
if(strlen(preg_replace('/[^0-9a-f]/', '', $this->getInput('u'))) == 24) {
|
||||||
// is input the userid ?
|
// is input the userid ?
|
||||||
$html = getSimpleHTMLDOM(
|
$html = getSimpleHTMLDOM(
|
||||||
self::URI . 'u/' . preg_replace('/[^0-9a-f]/', '', $this->getInput('u'))
|
self::URI . '/u/' . preg_replace('/[^0-9a-f]/', '', $this->getInput('u'))
|
||||||
) or returnServerError('No results for this query.');
|
) or returnServerError('No results for this query.');
|
||||||
} else { // input may be the username
|
} else { // input may be the username
|
||||||
$html = getSimpleHTMLDOM(
|
$html = getSimpleHTMLDOM(
|
||||||
self::URI . 'search?q=' . urlencode($this->getInput('u'))
|
self::URI . '/search?q=' . urlencode($this->getInput('u'))
|
||||||
) or returnServerError('No results for this query.');
|
) or returnServerError('No results for this query.');
|
||||||
|
|
||||||
for($j = 0; $j < 5; $j++) {
|
for($j = 0; $j < 5; $j++) {
|
||||||
|
@ -57,6 +56,6 @@ class WhydBridge extends BridgeAbstract {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return (!empty($this->userName) ? $this->userName . ' - ' : '') . 'Whyd Bridge';
|
return (!empty($this->userName) ? $this->userName . ' - ' : '') . 'Openwhyd Bridge';
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue