mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 01:55:21 +02:00
[bridges] use constants instead of variable members
Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
parent
556b8a2452
commit
9a0da733ef
129 changed files with 834 additions and 834 deletions
|
@ -1,13 +1,13 @@
|
|||
<?php
|
||||
class DollbooruBridge extends BridgeAbstract{
|
||||
|
||||
public $maintainer = "mitsukarenai";
|
||||
public $name = "Dollbooru";
|
||||
public $uri = "http://dollbooru.org/";
|
||||
public $description = "Returns images from given page";
|
||||
const MAINTAINER = "mitsukarenai";
|
||||
const NAME = "Dollbooru";
|
||||
const URI = "http://dollbooru.org/";
|
||||
const DESCRIPTION = "Returns images from given page";
|
||||
|
||||
|
||||
public $parameters = array( array(
|
||||
const PARAMETERS = array( array(
|
||||
'p'=>array(
|
||||
'name'=>'page',
|
||||
'type'=>'number'
|
||||
|
@ -18,16 +18,16 @@ class DollbooruBridge extends BridgeAbstract{
|
|||
public function collectData(){
|
||||
$page=$this->getInput('p');
|
||||
$tags = urlencode($this->getInput('t'));
|
||||
$html = $this->getSimpleHTMLDOM($this->uri."post/list/$tags/$page")
|
||||
$html = $this->getSimpleHTMLDOM(self::URI."post/list/$tags/$page")
|
||||
or $this->returnServerError('Could not request Dollbooru.');
|
||||
|
||||
|
||||
foreach($html->find('div[class=shm-image-list] a') as $element) {
|
||||
$item = array();
|
||||
$item['uri'] = $this->uri.$element->href;
|
||||
$item['uri'] = self::URI.$element->href;
|
||||
$item['postid'] = (int)preg_replace("/[^0-9]/",'', $element->getAttribute('data-post-id'));
|
||||
$item['timestamp'] = time();
|
||||
$thumbnailUri = $this->uri.$element->find('img', 0)->src;
|
||||
$thumbnailUri = self::URI.$element->find('img', 0)->src;
|
||||
$item['tags'] = $element->getAttribute('data-tags');
|
||||
$item['title'] = 'Dollbooru | '.$item['postid'];
|
||||
$item['content'] = '<a href="' . $item['uri'] . '"><img src="' . $thumbnailUri . '" /></a><br>Tags: '.$item['tags'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue