From f5a1af4a857c5745e22c86bbea5ac2d105f088b4 Mon Sep 17 00:00:00 2001 From: Albirew Date: Tue, 17 May 2016 19:06:15 +0200 Subject: [PATCH] Added Bridge for Hentai Haven (NSFW) Well, you know... For these times of "need"... --- bridges/HentaiHavenBridge.php | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 bridges/HentaiHavenBridge.php diff --git a/bridges/HentaiHavenBridge.php b/bridges/HentaiHavenBridge.php new file mode 100644 index 00000000..79da6f8e --- /dev/null +++ b/bridges/HentaiHavenBridge.php @@ -0,0 +1,38 @@ +maintainer = "albirew"; + $this->name = "Hentai Haven"; + $this->uri = "http://hentaihaven.org/"; + $this->description = "Returns releases from Hentai Haven"; + $this->update = "2015-01-16"; + + } + + public function collectData(array $param){ + $html = file_get_html('http://hentaihaven.org/') or $this->returnError('Could not request Hentai Haven.', 404); + foreach($html->find('div.zoe-grid') as $element) { + $item = new \Item(); + $item->uri = $this->getURI().$element->find('div.brick-content h3 a', 0)->href; + $item->thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src'); + $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.'


' . $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent p.description', 0)->innertext; + $this->items[] = $item; + } + } + public function getName(){ + return 'Hentai Haven'; + } + public function getURI(){ + return ''; + } + public function getDescription(){ + return "Hentai Haven | Everything Else is Irrelevant"; + } + public function getCacheDuration(){ + return 21600; // 6 hours + } +}