2014-05-26 02:30:46 +04:00
|
|
|
<?php
|
2016-09-04 02:25:05 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
class Rule34pahealBridge extends Shimmie2Bridge
|
|
|
|
{
|
|
|
|
const MAINTAINER = 'mitsukarenai';
|
|
|
|
const NAME = 'Rule34paheal';
|
|
|
|
const URI = 'https://rule34.paheal.net/';
|
|
|
|
const DESCRIPTION = 'Returns images from given page';
|
2014-05-26 02:30:46 +04:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
const PATHTODATA = '.shm-thumb';
|
2019-09-07 19:26:08 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
protected function getItemFromElement($element)
|
|
|
|
{
|
|
|
|
$item = [];
|
|
|
|
$item['uri'] = rtrim($this->getURI(), '/') . $element->find('.shm-thumb-link', 0)->href;
|
|
|
|
$item['id'] = (int)preg_replace('/[^0-9]/', '', $element->getAttribute(static::IDATTRIBUTE));
|
|
|
|
$item['timestamp'] = time();
|
|
|
|
$thumbnailUri = $element->find('a', 1)->href;
|
|
|
|
$item['categories'] = explode(' ', $element->getAttribute('data-tags'));
|
|
|
|
$item['title'] = $this->getName() . ' | ' . $item['id'];
|
|
|
|
$item['content'] = '<a href="'
|
|
|
|
. $item['uri']
|
|
|
|
. '"><img src="'
|
|
|
|
. $thumbnailUri
|
|
|
|
. '" /></a><br>Tags: '
|
|
|
|
. $element->getAttribute('data-tags');
|
|
|
|
return $item;
|
|
|
|
}
|
2014-05-26 02:30:46 +04:00
|
|
|
}
|