lolcat 2 rokov pred
rodič
commit
0dc9d62985
1 zmenil súbory, kde vykonal 16 pridanie a 15 odobranie
  1. 16 15
      scraper/qwant.php

+ 16 - 15
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(