2016-05-17 19:06:15 +02:00
|
|
|
<?php
|
|
|
|
class HentaiHavenBridge extends BridgeAbstract{
|
|
|
|
|
2016-08-30 11:23:55 +02:00
|
|
|
const MAINTAINER = "albirew";
|
|
|
|
const NAME = "Hentai Haven";
|
|
|
|
const URI = "http://hentaihaven.org/";
|
|
|
|
const DESCRIPTION = "Returns releases from Hentai Haven";
|
2016-05-17 19:06:15 +02:00
|
|
|
|
2016-08-25 01:24:53 +02:00
|
|
|
public function collectData(){
|
2016-08-30 11:23:55 +02:00
|
|
|
$html = $this->getSimpleHTMLDOM(self::URI)
|
2016-08-29 00:58:04 +02:00
|
|
|
or $this->returnServerError('Could not request Hentai Haven.');
|
2016-05-17 19:06:15 +02:00
|
|
|
foreach($html->find('div.zoe-grid') as $element) {
|
2016-08-22 18:55:59 +02:00
|
|
|
$item = array();
|
|
|
|
$item['uri'] = $element->find('div.brick-content h3 a', 0)->href;
|
2016-08-09 15:50:25 +02:00
|
|
|
$thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src');
|
2016-08-22 18:55:59 +02: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;
|
|
|
|
$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 19:06:15 +02:00
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
|
|
|
}
|
2016-08-09 20:01:21 +02:00
|
|
|
|
2016-05-17 19:06:15 +02:00
|
|
|
public function getCacheDuration(){
|
|
|
|
return 21600; // 6 hours
|
|
|
|
}
|
|
|
|
}
|