mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-29 02:50:31 +02:00
Merge branch 'core' of http://framagit.org/peetah/rss-bridge
This commit is contained in:
@@ -1,38 +1,28 @@
|
||||
<?php
|
||||
class CpasbienBridge extends HttpCachingBridgeAbstract{
|
||||
|
||||
public function loadMetadatas() {
|
||||
public $maintainer = "lagaisse";
|
||||
public $name = "Cpasbien Bridge";
|
||||
public $uri = "http://www.cpasbien.io";
|
||||
public $description = "Returns latest torrents from a request query";
|
||||
|
||||
$this->maintainer = "lagaisse";
|
||||
$this->name = "Cpasbien Bridge";
|
||||
$this->uri = "http://www.cpasbien.io";
|
||||
$this->description = "Returns latest torrents from a request query";
|
||||
|
||||
$this->parameters[] = array(
|
||||
'q'=>array(
|
||||
public $parameters = array( array(
|
||||
'q'=>array(
|
||||
'name'=>'Search',
|
||||
'required'=>true,
|
||||
'title'=>'Type your search'
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
)
|
||||
));
|
||||
|
||||
public function collectData(){
|
||||
$param=$this->parameters[$this->queriedContext];
|
||||
$html = '';
|
||||
if (isset($param['q']['value'])) { /* keyword search mode */
|
||||
$request = str_replace(" ","-",trim($param['q']['value']));
|
||||
$html = $this->getSimpleHTMLDOM($this->uri.'/recherche/'.urlencode($request).'.html') or $this->returnServerError('No results for this query.');
|
||||
} else {
|
||||
$this->returnClientError('You must specify a keyword (?q=...).');
|
||||
}
|
||||
$request = str_replace(" ","-",trim($this->getInput('q')));
|
||||
$html = $this->getSimpleHTMLDOM($this->uri.'/recherche/'.urlencode($request).'.html')
|
||||
or $this->returnServerError('No results for this query.');
|
||||
|
||||
foreach ($html->find('#gauche',0)->find('div') as $episode) {
|
||||
if ($episode->getAttribute('class')=='ligne0' || $episode->getAttribute('class')=='ligne1')
|
||||
if ($episode->getAttribute('class')=='ligne0' ||
|
||||
$episode->getAttribute('class')=='ligne1')
|
||||
{
|
||||
|
||||
$htmlepisode=$this->get_cached($episode->find('a', 0)->getAttribute('href'));
|
||||
|
||||
$item = array();
|
||||
@@ -58,8 +48,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
|
||||
|
||||
|
||||
public function getName(){
|
||||
return $this->parameters[$this->queriedContext]['q']['value']
|
||||
.' : '.$this->name;
|
||||
return $this->getInput('q').' : '.$this->name;
|
||||
}
|
||||
|
||||
public function getCacheDuration(){
|
||||
|
Reference in New Issue
Block a user