mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-01 22:30:14 +02:00
[bridges] use constants instead of variable members
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
class CNETBridge extends BridgeAbstract {
|
||||
|
||||
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.';
|
||||
const MAINTAINER = 'ORelio';
|
||||
const NAME = 'CNET News';
|
||||
const URI = 'http://www.cnet.com/';
|
||||
const 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(
|
||||
const PARAMETERS = array( array(
|
||||
'topic'=>array('name'=>'Topic name')
|
||||
));
|
||||
|
||||
@@ -37,7 +37,7 @@ class CNETBridge extends BridgeAbstract {
|
||||
return $article_html;
|
||||
}
|
||||
|
||||
$pageUrl = $this->uri.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/');
|
||||
$pageUrl = self::URI.(empty($this->getInput('topic')) ? '' : 'topics/'.$this->getInput('topic').'/');
|
||||
$html = $this->getSimpleHTMLDOM($pageUrl) or $this->returnServerError('Could not request CNET: '.$pageUrl);
|
||||
$limit = 0;
|
||||
|
||||
@@ -45,7 +45,7 @@ class CNETBridge extends BridgeAbstract {
|
||||
if ($limit < 8) {
|
||||
|
||||
$article_title = trim($element->find('h2', 0)->plaintext);
|
||||
$article_uri = $this->uri.($element->find('a', 0)->href);
|
||||
$article_uri = self::URI.($element->find('a', 0)->href);
|
||||
$article_timestamp = strtotime($element->find('time.assetTime', 0)->plaintext);
|
||||
$article_author = trim($element->find('a[rel=author]', 0)->plaintext);
|
||||
|
||||
|
Reference in New Issue
Block a user