2016-05-17 20:06:15 +03:00
|
|
|
<?php
|
|
|
|
class HentaiHavenBridge extends BridgeAbstract{
|
|
|
|
|
|
|
|
public function loadMetadatas() {
|
|
|
|
|
|
|
|
$this->maintainer = "albirew";
|
|
|
|
$this->name = "Hentai Haven";
|
|
|
|
$this->uri = "http://hentaihaven.org/";
|
|
|
|
$this->description = "Returns releases from Hentai Haven";
|
2016-08-17 15:45:08 +03:00
|
|
|
$this->update = '2016-08-17';
|
2016-05-17 20:06:15 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function collectData(array $param){
|
2016-08-17 15:45:08 +03:00
|
|
|
$html = $this->file_get_html('http://hentaihaven.org/') or $this->returnServerError('Could not request Hentai Haven.');
|
2016-05-17 20:06:15 +03:00
|
|
|
foreach($html->find('div.zoe-grid') as $element) {
|
|
|
|
$item = new \Item();
|
2016-08-09 21:01:21 +03:00
|
|
|
$item->uri = $element->find('div.brick-content h3 a', 0)->href;
|
2016-08-09 16:50:25 +03:00
|
|
|
$thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src');
|
2016-05-17 20:06:15 +03:00
|
|
|
$item->title = mb_convert_encoding(trim($element->find('div.brick-content h3 a', 0)->innertext), 'UTF-8', 'HTML-ENTITIES');
|
|
|
|
$item->tags = $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent span.tags', 0)->plaintext;
|
2016-08-09 16:50:25 +03:00
|
|
|
$item->content = 'Tags: ' . $item->tags.'<br><br><a href="' . $item->uri . '"><img width="300" height="169" src="' . $thumbnailUri . '" /></a><br>' . $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent p.description', 0)->innertext;
|
2016-05-17 20:06:15 +03:00
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
2016-08-09 21:01:21 +03:00
|
|
|
|
2016-05-17 20:06:15 +03:00
|
|
|
public function getCacheDuration(){
|
|
|
|
return 21600; // 6 hours
|
|
|
|
}
|
|
|
|
}
|