HentaiHavenBridge.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. class HentaiHavenBridge extends BridgeAbstract{
  3. public function loadMetadatas() {
  4. $this->maintainer = "albirew";
  5. $this->name = "Hentai Haven";
  6. $this->uri = "http://hentaihaven.org/";
  7. $this->description = "Returns releases from Hentai Haven";
  8. $this->update = "2015-01-16";
  9. }
  10. public function collectData(array $param){
  11. $html = $this->file_get_html('http://hentaihaven.org/') or $this->returnError('Could not request Hentai Haven.', 404);
  12. foreach($html->find('div.zoe-grid') as $element) {
  13. $item = new \Item();
  14. $item->uri = $this->getURI().$element->find('div.brick-content h3 a', 0)->href;
  15. $item->thumbnailUri = $element->find('a.thumbnail-image img', 0)->getAttribute('data-src');
  16. $item->title = mb_convert_encoding(trim($element->find('div.brick-content h3 a', 0)->innertext), 'UTF-8', 'HTML-ENTITIES');
  17. $item->tags = $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent span.tags', 0)->plaintext;
  18. $item->content = 'Tags: ' . $item->tags.'<br><br><a href="' . $item->uri . '"><img width="300" height="169" src="' . $item->thumbnailUri . '" /></a><br>' . $element->find('div.oFlyout_bg div.oFlyout div.flyoutContent p.description', 0)->innertext;
  19. $this->items[] = $item;
  20. }
  21. }
  22. public function getName(){
  23. return 'Hentai Haven';
  24. }
  25. public function getURI(){
  26. return '';
  27. }
  28. public function getDescription(){
  29. return "Hentai Haven | Everything Else is Irrelevant";
  30. }
  31. public function getCacheDuration(){
  32. return 21600; // 6 hours
  33. }
  34. }