From 2b103fc472081cb49267153a9fd3651d4c1fd713 Mon Sep 17 00:00:00 2001 From: vdbhb59 Date: Wed, 1 Oct 2025 10:26:29 +0530 Subject: [PATCH] Filter ads from the html endpoint https://git.lolcat.ca/lolcat/4get/commit/4b16fd58971321e6938046702210e2773573c621 --- scraper/ddg.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scraper/ddg.php b/scraper/ddg.php index af96465..a8d4d19 100644 --- a/scraper/ddg.php +++ b/scraper/ddg.php @@ -678,7 +678,13 @@ class ddg{ foreach($results as $result){ $this->fuckhtml->load($result); - + + if(stripos($result["attributes"]["class"], "result--ad") !== false){ + + // found an ad + continue; + } + $title = $this->fuckhtml ->getElementsByTagName(