diff options
author | lolcat <will@lolcat.ca> | 2024-04-21 20:26:10 -0400 |
---|---|---|
committer | lolcat <will@lolcat.ca> | 2024-04-21 20:26:10 -0400 |
commit | 0dc9d62985083174854251938daec896edef71bd (patch) | |
tree | ee49e97b01c2438b730f3e6dc910e177ca94f790 /scraper | |
parent | 9b8e0a4e0b5e528f7cedbf44c23b0093e7a95d12 (diff) |
qwant is a shit
Diffstat (limited to 'scraper')
-rw-r--r-- | scraper/qwant.php | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/scraper/qwant.php b/scraper/qwant.php index 9cc9b9e..8b160ed 100644 --- a/scraper/qwant.php +++ b/scraper/qwant.php @@ -336,6 +336,22 @@ class qwant{ 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["data"]["error_code"] === 5){ @@ -352,21 +368,6 @@ class qwant{ } // 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 if( |