Skip to content

Commit

Permalink
fix(rumble): exterminate double leading slashes in item url (#4381)
Browse files Browse the repository at this point in the history
Fixed for items with pub date newer than 31. jan 2025
  • Loading branch information
dvikan authored Jan 2, 2025
1 parent 97eebfb commit e825272
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions bridges/RumbleBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,10 @@ public function collectData()

$dom = getSimpleHTMLDOM($url);
foreach ($dom->find('ol.thumbnail__grid div.thumbnail__grid--item') as $video) {
$itemUrlString = self::URI . $video->find('a', 0)->href;
$itemUrl = Url::fromString($itemUrlString);
$href = $video->find('a', 0)->href;

$item = [
'title' => $video->find('h3', 0)->plaintext,

// Remove tracking parameter in query string
'uri' => $itemUrl->withQueryString(null)->__toString(),

'author' => $account . '@rumble.com',
'content' => defaultLinkTo($video, self::URI)->innertext,
];
Expand All @@ -78,6 +73,14 @@ public function collectData()
$publishedAt = new \DateTimeImmutable($time->getAttribute('datetime'));
$item['timestamp'] = $publishedAt->getTimestamp();
}

if (isset($publishedAt) && $publishedAt > new \DateTimeImmutable('2025-01-31')) {
$href = ltrim($href, '/');
}
$itemUrl = Url::fromString(self::URI . $href);
// Remove tracking parameter in query string
$item['uri'] = $itemUrl->withQueryString(null)->__toString();

$this->items[] = $item;
}
}
Expand Down

0 comments on commit e825272

Please sign in to comment.