forked from blallo/rss-bridge
(merge control)
This commit is contained in:
parent
c13c7a1d25
commit
e9e7a421ff
1 changed files with 21 additions and 14 deletions
|
@ -1,16 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* RssBridgeCpasBien
|
|
||||||
*
|
|
||||||
* 2015-05-17
|
|
||||||
*
|
|
||||||
* @name Cpasbien Bridge
|
|
||||||
* @homepage http://www.cpasbien.io/
|
|
||||||
* @description Returns latest torrent from request query
|
|
||||||
* @maintainer lagaisse
|
|
||||||
* @use1(q="keywords like this")
|
|
||||||
*/
|
|
||||||
|
|
||||||
// simple_html_dom funtion to get the dom from contents instead from file
|
// simple_html_dom funtion to get the dom from contents instead from file
|
||||||
function content_get_html($contents, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
function content_get_html($contents, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT)
|
||||||
{
|
{
|
||||||
|
@ -30,11 +18,30 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
|
||||||
|
|
||||||
private $request;
|
private $request;
|
||||||
|
|
||||||
|
public function loadMetadatas() {
|
||||||
|
|
||||||
|
$this->maintainer = "lagaisse";
|
||||||
|
$this->name = "Cpasbien Bridge";
|
||||||
|
$this->uri = "http://Cpasbien.pw/";
|
||||||
|
$this->description = "Returns latest torrent from request query";
|
||||||
|
$this->update = "2015-05-17";
|
||||||
|
|
||||||
|
$this->parameters[] =
|
||||||
|
'[
|
||||||
|
{
|
||||||
|
"name" : "keyword",
|
||||||
|
"identifier" : "q"
|
||||||
|
}
|
||||||
|
]';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function collectData(array $param){
|
public function collectData(array $param){
|
||||||
$html = '';
|
$html = '';
|
||||||
if (isset($param['q'])) { /* keyword search mode */
|
if (isset($param['q'])) { /* keyword search mode */
|
||||||
$this->request = str_replace(" ","-",trim($param['q']));
|
$this->request = str_replace(" ","-",trim($param['q']));
|
||||||
$html = file_get_html('http://www.cpasbien.io/recherche/'.urlencode($this->request).'.html') or $this->returnError('No results for this query.', 404);
|
$html = file_get_html('http://www.cpasbien.pw/recherche/'.urlencode($this->request).'.html') or $this->returnError('No results for this query.', 404);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->returnError('You must specify a keyword (?q=...).', 400);
|
$this->returnError('You must specify a keyword (?q=...).', 400);
|
||||||
|
@ -74,7 +81,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getURI(){
|
public function getURI(){
|
||||||
return 'http://www.cpasbien.io';
|
return 'http://www.cpasbien.pw';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCacheDuration(){
|
public function getCacheDuration(){
|
||||||
|
|
Loading…
Reference in a new issue