mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-09 16:38:50 +00:00
[Webfail] Extract timestamp from element (#1852)
Works only for German language.
This commit is contained in:
parent
6d4155f995
commit
a746987d7a
@ -84,6 +84,16 @@ class WebfailBridge extends BridgeAbstract {
|
|||||||
$description = $element->find('div.wf-news-description', 0)->innertext;
|
$description = $element->find('div.wf-news-description', 0)->innertext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$infoElement = $element->find('div.wf-small', 0);
|
||||||
|
if (!is_null($infoElement)) {
|
||||||
|
if (preg_match('/(\d{2}\.\d{2}\.\d{4})/m', $infoElement->innertext, $matches) === 1 && count($matches) == 2) {
|
||||||
|
$dt = DateTime::createFromFormat('!d.m.Y', $matches[1]);
|
||||||
|
if ($dt !== false) {
|
||||||
|
$item['timestamp'] = $dt->getTimestamp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$item['content'] = '<p>'
|
$item['content'] = '<p>'
|
||||||
. $description
|
. $description
|
||||||
. '</p><br><a href="'
|
. '</p><br><a href="'
|
||||||
|
Loading…
Reference in New Issue
Block a user