Parcourir la source

fix ddg bug with EOF result

lolcat il y a 1 an
Parent
commit
1ca2626ad9
1 fichiers modifiés avec 19 ajouts et 0 suppressions
  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
 				// parse search result
 				$out["web"][] = [
 				$out["web"][] = [
 					"title" =>
 					"title" =>