mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
Merge branch 'methods2functions' of https://framagit.org/peetah/rss-bridge
This commit is contained in:
commit
970e216c1f
114 changed files with 899 additions and 904 deletions
|
@ -33,7 +33,7 @@ class CastorusBridge extends BridgeAbstract {
|
|||
$title = $activity->find('a', 0);
|
||||
|
||||
if(!$title)
|
||||
$this->returnServerError('Cannot find title!');
|
||||
returnServerError('Cannot find title!');
|
||||
|
||||
return htmlspecialchars(trim($title->plaintext));
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class CastorusBridge extends BridgeAbstract {
|
|||
$url = $activity->find('a', 0);
|
||||
|
||||
if(!$url)
|
||||
$this->returnServerError('Cannot find url!');
|
||||
returnServerError('Cannot find url!');
|
||||
|
||||
return self::URI . $url->href;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ class CastorusBridge extends BridgeAbstract {
|
|||
$nodes = $activity->find('*');
|
||||
|
||||
if(!$nodes)
|
||||
$this->returnServerError('Cannot find nodes!');
|
||||
returnServerError('Cannot find nodes!');
|
||||
|
||||
foreach($nodes as $node){
|
||||
$node->outertext = '';
|
||||
|
@ -69,7 +69,7 @@ class CastorusBridge extends BridgeAbstract {
|
|||
$price = $activity->find('span', 1);
|
||||
|
||||
if(!$price)
|
||||
$this->returnServerError('Cannot find price!');
|
||||
returnServerError('Cannot find price!');
|
||||
|
||||
return $price->innertext;
|
||||
}
|
||||
|
@ -78,15 +78,15 @@ class CastorusBridge extends BridgeAbstract {
|
|||
$zip_filter = trim($this->getInput('zip'));
|
||||
$city_filter = trim($this->getInput('city'));
|
||||
|
||||
$html = $this->getSimpleHTMLDOM(self::URI);
|
||||
$html = getSimpleHTMLDOM(self::URI);
|
||||
|
||||
if(!$html)
|
||||
$this->returnServerError('Could not load data from ' . self::URI . '!');
|
||||
returnServerError('Could not load data from ' . self::URI . '!');
|
||||
|
||||
$activities = $html->find('div#activite/li');
|
||||
|
||||
if(!$activities)
|
||||
$this->returnServerError('Failed to find activities!');
|
||||
returnServerError('Failed to find activities!');
|
||||
|
||||
foreach($activities as $activity){
|
||||
$item = array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue