1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-01-29 03:47:42 +01:00

[NOSBridge] fix bridge (#4102)

CSS selectors were no longer valid.
This commit is contained in:
Alex Balgavy 2024-05-12 20:30:23 +02:00 committed by GitHub
parent 1c3024fca7
commit 776ee233bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ class NOSBridge extends BridgeAbstract
'name' => 'Onderwerp',
'title' => 'Kies onderwerp',
'values' => [
'Laatste nieuws' => 'nieuws',
'Laatste nieuws' => 'nieuws/laatste',
'Binnenland' => 'nieuws/binnenland',
'Buitenland' => 'nieuws/buitenland',
'Regionaal nieuws' => 'nieuws/regio',
@ -38,17 +38,16 @@ class NOSBridge extends BridgeAbstract
{
$url = sprintf('https://www.nos.nl/%s', $this->getInput('topic'));
$dom = getSimpleHTMLDOM($url);
$dom = $dom->find('ul.list-items', 0);
$dom = $dom->find('main#content > div > section > ul', 0);
if (!$dom) {
throw new \Exception(sprintf('Unable to find css selector on `%s`', $url));
}
$dom = defaultLinkTo($dom, $this->getURI());
foreach ($dom->find('li.list-items__item') as $article) {
$a = $article->find('a', 0);
foreach ($dom->find('li') as $article) {
$this->items[] = [
'title' => $article->find('h3.list-items__title', 0)->plaintext,
'uri' => $article->find('a.list-items__link', 0)->href,
'content' => $article->find('p.list-items__description', 0)->plaintext,
'title' => $article->find('h2', 0)->plaintext,
'uri' => $article->find('a', 0)->href,
'content' => $article->find('p', 0)->plaintext,
'timestamp' => strtotime($article->find('time', 0)->datetime),
];
}