[TheWhiteboard] Create new bridge for The Whiteboard (#1327)
This commit is contained in:
parent
2de45b163e
commit
583dfb4958
1 changed files with 22 additions and 0 deletions
22
bridges/TheWhiteboardBridge.php
Normal file
22
bridges/TheWhiteboardBridge.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue