BooruProject: tighter param control | WorldOfTanks: URL format update
This commit is contained in:
parent
f643617cac
commit
c030d011d2
2 changed files with 5 additions and 5 deletions
|
@ -2,24 +2,24 @@
|
|||
/**
|
||||
* RssBridgeBooruproject
|
||||
* Returns images from given page
|
||||
* 2014-05-25
|
||||
*
|
||||
* @name Booruproject
|
||||
* @homepage http://booru.org/
|
||||
* @description Returns images from given page and booruproject instance (****.booru.org)
|
||||
* @maintainer mitsukarenai
|
||||
* @update 2015-09-12
|
||||
* @use1(i="instance (required)", p="page", t="tags")
|
||||
*/
|
||||
class BooruprojectBridge extends BridgeAbstract{
|
||||
|
||||
public function collectData(array $param){
|
||||
$page = 0; $tags = '';
|
||||
if (isset($param['p'])) {
|
||||
if (!empty($param['p'])) {
|
||||
$page = (int)preg_replace("/[^0-9]/",'', $param['p']);
|
||||
$page = $page - 1;
|
||||
$page = $page * 20;
|
||||
}
|
||||
if (isset($param['t'])) {
|
||||
if (!empty($param['t'])) {
|
||||
$tags = '&tags='.urlencode($param['t']);
|
||||
}
|
||||
if (empty($param['i'])) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* @name World of Tanks
|
||||
* @description News about the tank slaughter game. Language can be fr, ?
|
||||
* @update 26/03/2014
|
||||
* @update 2015-09-12
|
||||
* @use1(lang="Searched language",category="Category id")
|
||||
*/
|
||||
define('WORLD_OF_TANKS', 'http://worldoftanks.eu/');
|
||||
|
@ -20,7 +20,7 @@ class WorldOfTanks extends HttpCachingBridgeAbstract{
|
|||
if(empty($param['category'])) {
|
||||
$this->uri = WORLD_OF_TANKS.$this->lang.NEWS;
|
||||
} else {
|
||||
$this->uri = WORLD_OF_TANKS.$this->lang.NEWS.$param['category']."/";
|
||||
$this->uri = WORLD_OF_TANKS.$this->lang.NEWS.'pc-browser/'.$param['category']."/";
|
||||
}
|
||||
$html = file_get_html($this->getURI()) or $this->returnError('Could not request '.$this->getURI(), 404);
|
||||
$this->message("loaded HTML from ".$this->getURI());
|
||||
|
|
Loading…
Reference in a new issue