1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-07-31 22:00:23 +02:00

[bridges] use constants instead of variable members

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière
2016-08-30 11:23:55 +02:00
parent 556b8a2452
commit 9a0da733ef
129 changed files with 834 additions and 834 deletions

View File

@@ -1,12 +1,12 @@
<?php
class WhydBridge extends BridgeAbstract{
public $maintainer = "kranack";
public $name = "Whyd Bridge";
public $uri = "http://www.whyd.com/";
public $description = "Returns 10 newest music from user profile";
const MAINTAINER = "kranack";
const NAME = "Whyd Bridge";
const URI = "http://www.whyd.com/";
const DESCRIPTION = "Returns 10 newest music from user profile";
public $parameters = array( array(
const PARAMETERS = array( array(
'u'=>array(
'name'=>'username/id',
'required'=>true
@@ -20,17 +20,17 @@ class WhydBridge extends BridgeAbstract{
if (strlen(preg_replace("/[^0-9a-f]/",'', $this->getInput('u'))) == 24){
// is input the userid ?
$html = $this->getSimpleHTMLDOM(
$this->uri.'u/'.preg_replace("/[^0-9a-f]/",'', $this->getInput('u'))
self::URI.'u/'.preg_replace("/[^0-9a-f]/",'', $this->getInput('u'))
) or $this->returnServerError('No results for this query.');
} else { // input may be the username
$html = $this->getSimpleHTMLDOM(
$this->uri.'search?q='.urlencode($this->getInput('u'))
self::URI.'search?q='.urlencode($this->getInput('u'))
) or $this->returnServerError('No results for this query.');
for ($j = 0; $j < 5; $j++) {
if (strtolower($html->find('div.user', $j)->find('a',0)->plaintext) == strtolower($this->getInput('u'))) {
$html = $this->getSimpleHTMLDOM(
$this->uri . $html->find('div.user', $j)->find('a', 0)->getAttribute('href')
self::URI . $html->find('div.user', $j)->find('a', 0)->getAttribute('href')
) or $this->returnServerError('No results for this query');
break;
}
@@ -44,8 +44,8 @@ class WhydBridge extends BridgeAbstract{
$item['author'] = $track->find('h2', 0)->plaintext;
$item['title'] = $track->find('h2', 0)->plaintext;
$item['content'] = $track->find('a.thumb',0) . '<br/>' . $track->find('h2', 0)->plaintext;
$item['id'] = $this->uri . $track->find('a.no-ajaxy',0)->getAttribute('href');
$item['uri'] = $this->uri . $track->find('a.no-ajaxy',0)->getAttribute('href');
$item['id'] = self::URI . $track->find('a.no-ajaxy',0)->getAttribute('href');
$item['uri'] = self::URI . $track->find('a.no-ajaxy',0)->getAttribute('href');
$this->items[] = $item;
}
}