forked from blallo/rss-bridge
Fix indentation and remove unnecessary lines
This commit is contained in:
parent
1e33b7c2ec
commit
01bdda5e19
1 changed files with 41 additions and 46 deletions
|
@ -1,15 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
class CADBridge extends BridgeAbstract{
|
class CADBridge extends BridgeAbstract{
|
||||||
|
|
||||||
public function loadMetadatas() {
|
public function loadMetadatas() {
|
||||||
|
|
||||||
$this->maintainer = "nyutag";
|
$this->maintainer = "nyutag";
|
||||||
$this->name = "CAD Bridge";
|
$this->name = "CAD Bridge";
|
||||||
$this->uri = "http://www.cad-comic.com/";
|
$this->uri = "http://www.cad-comic.com/";
|
||||||
$this->description = "Returns the newest articles.";
|
$this->description = "Returns the newest articles.";
|
||||||
$this->update = "2016-08-02";
|
$this->update = "2016-08-02";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function CADExtractContent($url) {
|
function CADExtractContent($url) {
|
||||||
$html3 = $this->file_get_html($url);
|
$html3 = $this->file_get_html($url);
|
||||||
$htmlpart = explode("/", $url);
|
$htmlpart = explode("/", $url);
|
||||||
|
@ -26,7 +24,6 @@ class CADBridge extends BridgeAbstract{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectData(array $param){
|
public function collectData(array $param){
|
||||||
|
|
||||||
function CADUrl($string) {
|
function CADUrl($string) {
|
||||||
$html2 = explode("\"", $string);
|
$html2 = explode("\"", $string);
|
||||||
$string = $html2[1];
|
$string = $html2[1];
|
||||||
|
@ -35,10 +32,9 @@ class CADBridge extends BridgeAbstract{
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$html = $this->file_get_html('http://cdn2.cad-comic.com/rss.xml') or $this->returnError('Could not request CAD.', 404);
|
$html = $this->file_get_html('http://cdn2.cad-comic.com/rss.xml') or $this->returnError('Could not request CAD.', 404);
|
||||||
$limit = 0;
|
$limit = 0;
|
||||||
|
|
||||||
foreach($html->find('item') as $element) {
|
foreach($html->find('item') as $element) {
|
||||||
if($limit < 5) {
|
if($limit < 5) {
|
||||||
$item = new \Item();
|
$item = new \Item();
|
||||||
|
@ -52,7 +48,6 @@ class CADBridge extends BridgeAbstract{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
|
@ -65,6 +60,6 @@ class CADBridge extends BridgeAbstract{
|
||||||
|
|
||||||
public function getCacheDuration(){
|
public function getCacheDuration(){
|
||||||
return 3600*2; // 2 hours
|
return 3600*2; // 2 hours
|
||||||
// return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
?>
|
Loading…
Reference in a new issue