From 0130adcd6c96e34a1c965d611641fb2e194e1cee Mon Sep 17 00:00:00 2001
From: Dag
' . $notSupported->innertext;
+ $message = (string) $notSupported->innertext;
}
if ($messageDiv->find('div.tgme_widget_message_forwarded_from', 0)) {
From 7b55eb3824d6bdad898ec7d8172b6313950343f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane?=
{$question}
{$post['addresseeData']['username']} answered:
-{$answer}-EOD; - - return $content; - } - - private function ellipsisTitle($text) - { - $length = 150; - - if (strlen($text) > $length) { - $text = explode('
elements for code snippets. For example the code line in https://www.golem.de/news/falsch-deklarierte-hdds-betrug-bei-festplatten-bleibt-ein-problem-2505-196675.html --- bridges/GolemBridge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridges/GolemBridge.php b/bridges/GolemBridge.php index 219233f4..fbd154e3 100644 --- a/bridges/GolemBridge.php +++ b/bridges/GolemBridge.php @@ -152,7 +152,7 @@ class GolemBridge extends FeedExpander $img->src = $img->getAttribute('data-src-full'); } - foreach ($content->find('p, h1, h2, h3, img[src*="."], iframe, video') as $element) { + foreach ($content->find('p, h1, h2, h3, pre, img[src*="."], iframe, video') as $element) { $item .= $element; } From b8064d9dfe210cc20fad303222e104460413071d Mon Sep 17 00:00:00 2001 From: Anton SmirnovDate: Fri, 30 May 2025 12:05:36 +0300 Subject: [PATCH 09/14] [EpicGamesFree] Fixes: url not set, other promos shown (#4575) * URI was not set because of the typo * Filter out other promos --- bridges/EpicGamesFreeBridge.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bridges/EpicGamesFreeBridge.php b/bridges/EpicGamesFreeBridge.php index 087b95be..3b16cd5b 100644 --- a/bridges/EpicGamesFreeBridge.php +++ b/bridges/EpicGamesFreeBridge.php @@ -27,7 +27,7 @@ class EpicGamesFreeBridge extends BridgeAbstract 'Türkçe' => 'tr', '简体中文' => 'zh-CN', '繁體中文' => 'zh-Hant', - ], + ], 'title' => 'Language for game information', 'defaultValue' => 'en-US', ], @@ -51,16 +51,21 @@ class EpicGamesFreeBridge extends BridgeAbstract $data = $json['data']['Catalog']['searchStore']['elements']; foreach ($data as $element) { - if (!isset($element['promotions']['promotionalOffers'][0])) { + $promo = $element['promotions']['promotionalOffers'][0]['promotionalOffers'][0] ?? false; + if ( + !$promo || + $promo['discountSetting']['discountType'] !== 'PERCENTAGE' || + $promo['discountSetting']['discountPercentage'] !== 0 + ) { continue; } $item = [ 'author' => $element['seller']['name'], 'content' => $element['description'], 'enclosures' => array_map(fn($item) => $item['url'], $element['keyImages']), - 'timestamp' => strtotime($element['promotions']['promotionalOffers'][0]['promotionalOffers'][0]['startDate']), + 'timestamp' => strtotime($promo['startDate']), 'title' => $element['title'], - 'url' => parent::getURI() . $this->getInput('locale') . '/p/' . $element['urlSlug'], + 'uri' => parent::getURI() . $this->getInput('locale') . '/p/' . $element['productSlug'], ]; $this->items[] = $item; } From 98e03011dbb80ea9cea3ef8c5e29a1778f169cc9 Mon Sep 17 00:00:00 2001 From: Dag Date: Tue, 3 Jun 2025 21:24:35 +0200 Subject: [PATCH 10/14] chore: prepare for 2025-06-03 release (#4583) --- lib/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Configuration.php b/lib/Configuration.php index 60bf80fb..79f2922c 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -7,7 +7,7 @@ */ final class Configuration { - private const VERSION = '2025-01-26'; + private const VERSION = '2025-06-03'; private static $config = []; From 7aa54602cfe0b5ed2ea91c0588fd80057fa6eb59 Mon Sep 17 00:00:00 2001 From: Tobias Alexander Franke Date: Wed, 4 Jun 2025 22:15:28 +0200 Subject: [PATCH 11/14] [FabBridge] Pull 100% discounted items via Fab API (#4584) * [FabBridge] Pull 100% discounted items via Fab API * [FabBridge] Linter fixes --- bridges/FabBridge.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bridges/FabBridge.php diff --git a/bridges/FabBridge.php b/bridges/FabBridge.php new file mode 100644 index 00000000..6596f869 --- /dev/null +++ b/bridges/FabBridge.php @@ -0,0 +1,43 @@ +results as $item) { + $thumbnail = $item->thumbnails[0]->mediaUrl; + $itemurl = static::URI . '/listings/' . $item->uid; + + $itemapiurl = static::URI . '/i/listings/' . $item->uid; + $itemjson = getContents($itemapiurl, $header); + $itemjson = json_decode($itemjson); + + $this->items[] = [ + 'title' => $item->title, + 'author' => $item->user->sellerName, + 'uri' => $itemurl, + 'timestamp' => strtotime($item->lastUpdatedAt), + 'content' => ' ' . $itemjson->description, + ]; + } + } +} From 514b3edf0b85c37c69ada3980d355bd6a3c3b052 Mon Sep 17 00:00:00 2001 From: Jonathan Kay
Date: Thu, 5 Jun 2025 17:41:20 -0400 Subject: [PATCH 12/14] [GoComicsBridge] Fix for JSON being removed (#4585) - Now redirects to first comic from landing page - Switched to meta tags --- bridges/GoComicsBridge.php | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/bridges/GoComicsBridge.php b/bridges/GoComicsBridge.php index 968c2c4d..a5784091 100644 --- a/bridges/GoComicsBridge.php +++ b/bridges/GoComicsBridge.php @@ -31,25 +31,21 @@ class GoComicsBridge extends BridgeAbstract public function collectData() { $link = $this->getURI(); + $landingpage = getSimpleHTMLDOM($link); + + $link = $landingpage->find('div[data-post-url]', 0)->getAttribute('data-post-url'); for ($i = 0; $i < $this->getInput('limit'); $i++) { $html = getSimpleHTMLDOM($link); - // get json data from the first page - $json = $html->find('div[class^="ShowComicViewer_showComicViewer__comic__"] script[type="application/ld+json"]', 0)->innertext; - $data = json_decode($json, false); + + $imagelink = $html->find('meta[property="og:image"]', 0)->content; + $parts = explode('/', $link); + $date = DateTime::createFromFormat('Y/m/d', implode('/', array_slice($parts, -3))); + $title = $html->find('meta[property="og:title"]', 0)->content; + preg_match('/by (.*?) for/', $title, $authormatches); + $author = $authormatches[1] ?? 'GoComics'; $item = []; - - $author = $data->author->name; - $imagelink = $data->contentUrl; - $date = $data->datePublished; - $title = $data->name . ' - GoComics'; - - // get a permlink for this day's comic if there isn't one specified - if ($link === $this->getURI()) { - $link = $this->getURI() . '/' . DateTime::createFromFormat('F j, Y', $date)->format('Y/m/d'); - } - $item['id'] = $imagelink; $item['uri'] = $link; $item['author'] = $author; @@ -57,7 +53,7 @@ class GoComicsBridge extends BridgeAbstract if ($this->getInput('date-in-title') === true) { $item['title'] = $title; } - $item['timestamp'] = DateTime::createFromFormat('F j, Y', $date)->setTime(0, 0, 0)->getTimestamp(); + $item['timestamp'] = $date->setTime(0, 0, 0)->getTimestamp(); $item['content'] = ' '; $link = rtrim(self::URI, '/') . $html->find('a[class*="ComicNavigation_controls__button_previous__"]', 0)->href; From 8dada08e6920eacf387f2b8e0086350760556290 Mon Sep 17 00:00:00 2001 From: sysadminstory
Date: Sat, 7 Jun 2025 23:31:02 +0200 Subject: [PATCH 13/14] [IdealoBridge] Bypass bot protection (#4588) Add some headers (User-Agent, Accept, Accept-Language) and activate compression to bypass the bot protection --- bridges/IdealoBridge.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/bridges/IdealoBridge.php b/bridges/IdealoBridge.php index 55cee467..05a2ebb8 100644 --- a/bridges/IdealoBridge.php +++ b/bridges/IdealoBridge.php @@ -35,6 +35,16 @@ class IdealoBridge extends BridgeAbstract ] ]; + private $headers = [ + 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0', + 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8', + 'Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.5,en;q=0.3' + ]; + private $options = [ + CURLOPT_TRANSFER_ENCODING => 1, + CURLOPT_ACCEPT_ENCODING => 'gzip, deflate, br' + ]; + public function getIcon() { return 'https://cdn.idealo.com/storage/ids-assets/ico/favicon.ico'; @@ -53,10 +63,7 @@ class IdealoBridge extends BridgeAbstract // The cache does not contain the title of the bridge, we must get it and save it in the cache if ($product === null) { - $header = [ - 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15' - ]; - $html = getSimpleHTMLDOM($link, $header); + $html = getSimpleHTMLDOM($link, $this->headers, $this->options); $product = $html->find('.oopStage-title', 0)->find('span', 0)->plaintext; $this->saveCacheValue($keyTITLE, $product); } @@ -123,13 +130,8 @@ class IdealoBridge extends BridgeAbstract } public function collectData() { - // Needs header with user-agent to function properly. - $header = [ - 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15' - ]; - $link = $this->getInput('Link'); - $html = getSimpleHTMLDOM($link, $header); + $html = getSimpleHTMLDOM($link, $this->headers, $this->options); // Get Productname $titleobj = $html->find('.oopStage-title', 0); From 354cea09a7e8fa4bc83c9e118083891a678bad1b Mon Sep 17 00:00:00 2001 From: Jonathan Kay Date: Sun, 8 Jun 2025 15:57:41 -0400 Subject: [PATCH 14/14] [GoComicsBridge] Add fallback when link to current comic is missing (#4589) --- bridges/GoComicsBridge.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bridges/GoComicsBridge.php b/bridges/GoComicsBridge.php index a5784091..8e78ce5e 100644 --- a/bridges/GoComicsBridge.php +++ b/bridges/GoComicsBridge.php @@ -32,8 +32,20 @@ class GoComicsBridge extends BridgeAbstract { $link = $this->getURI(); $landingpage = getSimpleHTMLDOM($link); - - $link = $landingpage->find('div[data-post-url]', 0)->getAttribute('data-post-url'); + $element = $landingpage->find('div[data-post-url]', 0); + if ($element) { + $link = $element->getAttribute('data-post-url'); + } else { // fallback for comics without data-post-url (assumes daily comic) + $nextcomiclink = $landingpage->find('a[class*="ComicNavigation_controls__button_previous__"]', 0)->href; + preg_match('/(\d{4}\/\d{2}\/\d{2})/', $nextcomiclink, $nclmatches); + if (!empty($nclmatches[1])) { + $nextdate = new DateTime($nclmatches[1]); + $nextdate = $nextdate->modify('+1 day')->format('Y/m/d'); + $link = $link . '/' . $nextdate; + } else { + throw new \Exception('Could not find the first comic URL. Please create a new GitHub issue.'); + } + } for ($i = 0; $i < $this->getInput('limit'); $i++) { $html = getSimpleHTMLDOM($link);