mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-13 03:54:04 +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,11 +1,11 @@
|
||||
<?php
|
||||
class HDWallpapersBridge extends BridgeAbstract {
|
||||
public $maintainer = "nel50n";
|
||||
public $name = "HD Wallpapers Bridge";
|
||||
public $uri = "http://www.hdwallpapers.in/";
|
||||
public $description = "Returns the latests wallpapers from HDWallpapers";
|
||||
const MAINTAINER = "nel50n";
|
||||
const NAME = "HD Wallpapers Bridge";
|
||||
const URI = "http://www.hdwallpapers.in/";
|
||||
const DESCRIPTION = "Returns the latests wallpapers from HDWallpapers";
|
||||
|
||||
public $parameters = array( array(
|
||||
const PARAMETERS = array( array(
|
||||
'c'=>array(
|
||||
'name'=>'category',
|
||||
'defaultValue'=>'latest_wallpapers'
|
||||
@@ -29,7 +29,7 @@ class HDWallpapersBridge extends BridgeAbstract {
|
||||
$lastpage = 1;
|
||||
|
||||
for ($page = 1; $page <= $lastpage; $page++) {
|
||||
$link = $this->uri.'/'.$category.'/page/'.$page;
|
||||
$link = self::URI.'/'.$category.'/page/'.$page;
|
||||
$html = $this->getSimpleHTMLDOM($link) or $this->returnServerError('No results for this query.');
|
||||
|
||||
if ($page === 1) {
|
||||
@@ -42,10 +42,10 @@ class HDWallpapersBridge extends BridgeAbstract {
|
||||
|
||||
$item = array();
|
||||
// http://www.hdwallpapers.in/download/yosemite_reflections-1680x1050.jpg
|
||||
$item['uri'] = $this->uri.'/download'.str_replace('wallpapers.html', $this->getInput('r').'.jpg', $element->href);
|
||||
$item['uri'] = self::URI.'/download'.str_replace('wallpapers.html', $this->getInput('r').'.jpg', $element->href);
|
||||
$item['timestamp'] = time();
|
||||
$item['title'] = $element->find('p', 0)->text();
|
||||
$item['content'] = $item['title'].'<br><a href="'.$item['uri'].'"><img src="'.$this->uri.$thumbnail->src.'" /></a>';
|
||||
$item['content'] = $item['title'].'<br><a href="'.$item['uri'].'"><img src="'.self::URI.$thumbnail->src.'" /></a>';
|
||||
$this->items[] = $item;
|
||||
|
||||
$num++;
|
||||
|
Reference in New Issue
Block a user