diff --git a/bridges/DilbertBridge.php b/bridges/DilbertBridge.php index a80d8de..eb094cc 100644 --- a/bridges/DilbertBridge.php +++ b/bridges/DilbertBridge.php @@ -1,7 +1,7 @@ returnError('Could not request Dilbert.', 404); - - foreach($html->find('div.STR_Image') as $element) { + + foreach($html->find('section.comic-item') as $element) { + $comic = $element->find('img', 0); + $item = new Item(); - $href = $element->find('a',0)->href; - $item->uri = 'http://dilbert.com' . $href; - $content = str_replace('src="/', 'src="http://dilbert.com/',$element->innertext); - $content = str_replace('href="/', 'href="http://dilbert.com/',$content); - $item->content = $content; - $time = strtotime(substr($href, (strrpos($href, "/", -10) + 1), 10)); - $item->title = date("d/m/Y", $time); - $item->timestamp = $time; + $item->uri = $element->find('a',0)->href; + $item->content = '' . $comic->alt . ''; + $item->title = $comic->alt; + $item->timestamp = strtotime($element->find('h3', 0)->plaintext); $this->items[] = $item; } }