Selaa lähdekoodia

filter ads from the html endpoint

lolcat 11 kuukautta sitten
vanhempi
sitoutus
4b16fd5897
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      scraper/ddg.php

+ 6 - 0
scraper/ddg.php

@@ -679,6 +679,12 @@ class ddg{
 			
 			$this->fuckhtml->load($result);
 			
+			if(stripos($result["attributes"]["class"], "result--ad") !== false){
+				
+				// found an ad
+				continue;
+			}
+			
 			$title =
 				$this->fuckhtml
 				->getElementsByTagName(