1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-01 14:20:16 +02:00
This commit is contained in:
logmanoriginal
2016-09-02 17:36:51 +02:00
131 changed files with 888 additions and 876 deletions

View File

@@ -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,8 +37,7 @@ class CNETBridge extends BridgeAbstract {
return $article_html;
}
$topic=$this->getInput('topic');
$pageUrl = $this->uri.(empty($topic) ? '' : 'topics/'.$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;
@@ -46,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);