mirror of
https://git.lolcat.ca/lolcat/4get.git
synced 2024-11-08 17:43:07 -05:00
qwant is a shit
This commit is contained in:
parent
9b8e0a4e0b
commit
0dc9d62985
1 changed files with 16 additions and 15 deletions
|
@ -336,6 +336,22 @@ class qwant{
|
||||||
throw new Exception("Server returned an error:\n" . $json["data"]["message"][0]);
|
throw new Exception("Server returned an error:\n" . $json["data"]["message"][0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$out = [
|
||||||
|
"status" => "ok",
|
||||||
|
"spelling" => [
|
||||||
|
"type" => "no_correction",
|
||||||
|
"using" => null,
|
||||||
|
"correction" => null
|
||||||
|
],
|
||||||
|
"npt" => null,
|
||||||
|
"answer" => [],
|
||||||
|
"web" => [],
|
||||||
|
"image" => [],
|
||||||
|
"video" => [],
|
||||||
|
"news" => [],
|
||||||
|
"related" => []
|
||||||
|
];
|
||||||
|
|
||||||
if($json["status"] != "success"){
|
if($json["status"] != "success"){
|
||||||
|
|
||||||
if($json["data"]["error_code"] === 5){
|
if($json["data"]["error_code"] === 5){
|
||||||
|
@ -352,21 +368,6 @@ class qwant{
|
||||||
}
|
}
|
||||||
|
|
||||||
// data is OK, parse
|
// data is OK, parse
|
||||||
$out = [
|
|
||||||
"status" => "ok",
|
|
||||||
"spelling" => [
|
|
||||||
"type" => "no_correction",
|
|
||||||
"using" => null,
|
|
||||||
"correction" => null
|
|
||||||
],
|
|
||||||
"npt" => null,
|
|
||||||
"answer" => [],
|
|
||||||
"web" => [],
|
|
||||||
"image" => [],
|
|
||||||
"video" => [],
|
|
||||||
"news" => [],
|
|
||||||
"related" => []
|
|
||||||
];
|
|
||||||
|
|
||||||
// get instant answer
|
// get instant answer
|
||||||
if(
|
if(
|
||||||
|
|
Loading…
Reference in a new issue