2016-05-17 20:06:15 +03:00
|
|
|
<?php
|
|
|
|
class HentaiHavenBridge extends BridgeAbstract{
|
|
|
|
|
2016-08-30 12:23:55 +03:00
|
|
|
const MAINTAINER = "albirew";
|
|
|
|
const NAME = "Hentai Haven";
|
|
|
|
const URI = "http://hentaihaven.org/";
|
2016-09-25 18:04:28 +03:00
|
|
|
const CACHE_TIMEOUT = 21600; // 6h
|
2016-08-30 12:23:55 +03:00
|
|
|
const DESCRIPTION = "Returns releases from Hentai Haven";
|
2016-05-17 20:06:15 +03:00
|
|
|
|
2016-08-25 02:24:53 +03:00
|
|
|
public function collectData(){
|
2016-09-26 00:22:33 +03:00
|
|
|
$html = getSimpleHTMLDOM(self::URI)
|
|
|
|
or returnServerError('Could not request Hentai Haven.');
|
2016-05-17 20:06:15 +03:00
|
|
|
foreach($html->find('div.zoe-grid') as $element) {
|
2016-08-22 19:55:59 +03:00
|
|
|
$item = array();
|
|
|
|
$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-08-22 19:55:59 +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;
|
|
|
|
$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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|