Skip to content

Commit

Permalink
[TheWhiteboard] Create new bridge for The Whiteboard (#1327)
Browse files Browse the repository at this point in the history
  • Loading branch information
girlpunk authored and logmanoriginal committed Dec 1, 2019
1 parent 2de45b1 commit 583dfb4
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bridges/TheWhiteboardBridge.php
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 583dfb4

Please sign in to comment.