mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[Webfail] Extract timestamp from element (#1852)
Works only for German language.
This commit is contained in:
parent
6d4155f995
commit
a746987d7a
1 changed files with 10 additions and 0 deletions
|
@ -84,6 +84,16 @@ class WebfailBridge extends BridgeAbstract {
|
|||
$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>'
|
||||
. $description
|
||||
. '</p><br><a href="'
|
||||
|
|
Loading…
Add table
Reference in a new issue