diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php
index 1fa5a24..e6d3424 100644
--- a/bridges/DilbertBridge.php
+++ b/bridges/DilbertBridge.php
@@ -3,44 +3,43 @@ class DilbertBridge extends BridgeAbstract {
public function loadMetadatas() {
- $this->maintainer = "kranack";
- $this->name = "Dilbert Daily Strip";
- $this->uri = "http://dilbert.com/";
- $this->description = "The Unofficial Dilbert Daily Comic Strip";
- $this->update = "14/02/2016";
+ $this->maintainer = 'kranack';
+ $this->name = $this->getName();
+ $this->uri = $this->getURI();
+ $this->description = $this->getDescription();
+ $this->update = "14/05/2016";
}
public function collectData(array $param) {
- $html = file_get_html('http://dilbert.com/') or $this->returnError('Could not request Dilbert.', 500);
+ $html = file_get_html($this->getURI()) or $this->returnError('Could not request Dilbert: '.$this->getURI(), 500);
foreach ($html->find('section.comic-item') as $element) {
$img = $element->find('img', 0);
+ $link = $element->find('a', 0);
$comic = $img->src;
- $title = $img->alt;
- $url = $element->find('a', 0)->href;
- $author = trim(substr($title, strpos($title, ' - Dilbert by ') + 14));
- $title = trim(substr($title, 0, strpos($title, ' - ')));
+ $title = $link->alt;
+ $url = $link->href;
$date = substr($url, 25);
if (empty($title))
- $title = "Dilbert Comic Strip on ".$date;
+ $title = 'Dilbert Comic Strip on '.$date;
$date = strtotime($date);
$item = new \Item();
$item->uri = $url;
$item->thumbnailUri = $comic;
$item->title = $title;
- $item->author = $author;
+ $item->author = 'Scott Adams';
$item->timestamp = $date;
- $item->content = '';
+ $item->content = '';
$this->items[] = $item;
}
}
public function getName() {
- return 'Dilbert Bridge';
+ return 'Dilbert Daily Strip';
}
public function getURI() {
@@ -48,7 +47,7 @@ class DilbertBridge extends BridgeAbstract {
}
public function getDescription() {
- return 'Dilbert Daily Strip Bridge';
+ return 'The Unofficial Dilbert Daily Comic Strip';
}
public function getCacheDuration() {