[DavesTrailerPageBridge] Add timestamps to feed (#2456)

This commit is contained in:
Yaman Qalieh 2022-03-24 20:02:16 -04:00 committed by GitHub
parent 55acf661b9
commit e0d99f2a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -9,7 +9,14 @@ class DavesTrailerPageBridge extends BridgeAbstract {
$html = getSimpleHTMLDOM(static::URI)
or returnClientError('No results for this query.');
foreach ($html->find('tr[!align]') as $tr) {
$curr_date = null;
foreach ($html->find('tr') as $tr) {
// If it's a date row, update the current date
if ($tr->align == 'center') {
$curr_date = $tr->plaintext;
continue;
}
$item = array();
// title
@ -21,6 +28,9 @@ class DavesTrailerPageBridge extends BridgeAbstract {
// uri
$item['uri'] = $tr->find('a', 3)->getAttribute('href');
// date: parsed by FeedItem using strtotime
$item['timestamp'] = $curr_date;
$this->items[] = $item;
}
}