2019-12-01 13:30:16 +03:00
|
|
|
<?php
|
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
class TheWhiteboardBridge extends BridgeAbstract
|
|
|
|
{
|
|
|
|
const NAME = 'The Whiteboard';
|
|
|
|
const URI = 'https://www.the-whiteboard.com/';
|
|
|
|
const DESCRIPTION = 'Get the latest comic from The Whiteboard';
|
|
|
|
const MAINTAINER = 'CyberJacob';
|
2019-12-01 13:30:16 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
public function collectData()
|
|
|
|
{
|
|
|
|
$item = [];
|
2019-12-01 13:30:16 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
$html = getSimpleHTMLDOM(self::URI);
|
2019-12-01 13:30:16 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
$image = $html->find('center', 1)->find('img', 0);
|
|
|
|
$image->src = self::URI . '/' . $image->src;
|
2019-12-01 13:30:16 +03:00
|
|
|
|
2022-07-01 16:10:30 +03:00
|
|
|
$item['title'] = explode("\r\n", $html->find('center', 1)->plaintext)[0];
|
|
|
|
$item['content'] = $image;
|
|
|
|
$item['timestamp'] = explode("\r\n", $html->find('center', 1)->plaintext)[0];
|
|
|
|
|
|
|
|
$this->items[] = $item;
|
|
|
|
}
|
2019-12-01 13:30:16 +03:00
|
|
|
}
|