[DilbertBridge] Fixed URI and item title (#976)

This commit is contained in:
fulmeek 2018-12-26 21:11:45 +01:00 committed by LogMANOriginal
parent 10659dd453
commit 185a773e74

View file

@ -3,7 +3,7 @@ class DilbertBridge extends BridgeAbstract {
const MAINTAINER = 'kranack'; const MAINTAINER = 'kranack';
const NAME = 'Dilbert Daily Strip'; const NAME = 'Dilbert Daily Strip';
const URI = 'http://dilbert.com'; const URI = 'https://dilbert.com';
const CACHE_TIMEOUT = 21600; // 6h const CACHE_TIMEOUT = 21600; // 6h
const DESCRIPTION = 'The Unofficial Dilbert Daily Comic Strip'; const DESCRIPTION = 'The Unofficial Dilbert Daily Comic Strip';
@ -17,9 +17,9 @@ class DilbertBridge extends BridgeAbstract {
$img = $element->find('img', 0); $img = $element->find('img', 0);
$link = $element->find('a', 0); $link = $element->find('a', 0);
$comic = $img->src; $comic = $img->src;
$title = $link->alt; $title = $img->alt;
$url = $link->href; $url = $link->href;
$date = substr($url, 25); $date = substr(strrchr($url, '/'), 1);
if (empty($title)) if (empty($title))
$title = 'Dilbert Comic Strip on ' . $date; $title = 'Dilbert Comic Strip on ' . $date;
$date = strtotime($date); $date = strtotime($date);