Compare commits
No commits in common. "bad8d7ad5062a7e346b6f2774159b8381420cdb7" and "96f4fc927abfb5dc9eb7387929be757bf6787a80" have entirely different histories.
bad8d7ad50
...
96f4fc927a
|
@ -453,8 +453,6 @@ class qwant{
|
||||||
switch($item["type"]){ // ignores ads
|
switch($item["type"]){ // ignores ads
|
||||||
|
|
||||||
case "web":
|
case "web":
|
||||||
|
|
||||||
$first_iteration = true;
|
|
||||||
foreach($item["items"] as $result){
|
foreach($item["items"] as $result){
|
||||||
|
|
||||||
if(isset($result["thumbnailUrl"])){
|
if(isset($result["thumbnailUrl"])){
|
||||||
|
@ -485,25 +483,6 @@ class qwant{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// detect gibberish results
|
|
||||||
if(
|
|
||||||
$first_iteration &&
|
|
||||||
preg_match(
|
|
||||||
"/^" .
|
|
||||||
preg_quote(
|
|
||||||
$this->trimdots(
|
|
||||||
$result["source"]
|
|
||||||
),
|
|
||||||
"/"
|
|
||||||
) .
|
|
||||||
"/",
|
|
||||||
$result["url"]
|
|
||||||
) !== 1
|
|
||||||
){
|
|
||||||
|
|
||||||
throw new Exception("Qwant returned gibberish results");
|
|
||||||
}
|
|
||||||
|
|
||||||
$out["web"][] = [
|
$out["web"][] = [
|
||||||
"title" => $this->trimdots($result["title"]),
|
"title" => $this->trimdots($result["title"]),
|
||||||
"description" => $this->trimdots($result["desc"]),
|
"description" => $this->trimdots($result["desc"]),
|
||||||
|
@ -514,8 +493,6 @@ class qwant{
|
||||||
"sublink" => $sublinks,
|
"sublink" => $sublinks,
|
||||||
"table" => []
|
"table" => []
|
||||||
];
|
];
|
||||||
|
|
||||||
$first_iteration = false;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue