Explorar el Código

fix ddg bug with EOF result

lolcat hace 1 año
padre
commit
1ca2626ad9
Se han modificado 1 ficheros con 19 adiciones y 0 borrados
  1. 19 0
      scraper/ddg.php

+ 19 - 0
scraper/ddg.php

@@ -612,6 +612,25 @@ class ddg{
 					}
 				}
 				
+				$title =
+					$this->titledots(
+						$this->fuckhtml
+						->getTextContent(
+							$item["t"]
+						)
+					);
+				
+				if(
+					$title == "EOF" &&
+					strpos(
+						$item["c"],
+						"google"
+					)
+				){
+					
+					continue;
+				}
+				
 				// parse search result
 				$out["web"][] = [
 					"title" =>