[TheWhiteboard] Create new bridge for The Whiteboard (#1327)

This commit is contained in:
Jacob Mansfield 2019-12-01 10:30:16 +00:00 committed by LogMANOriginal
parent 2de45b163e
commit 583dfb4958

View file

@ -0,0 +1,22 @@
<?php
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';
public function collectData() {
$item = array();
$html = getSimpleHTMLDOM(self::URI) or returnServerError('Could not load The Whiteboard.');
$image = $html->find('center', 1)->find('img', 0);
$image->src = self::URI . '/' . $image->src;
$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;
}
}