summaryrefslogtreecommitdiff
path: root/scraper/qwant.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2024-04-27 15:03:56 -0400
committerlolcat <will@lolcat.ca>2024-04-27 15:03:56 -0400
commitf8d46df1e858401d93c5fa885777113994a03c86 (patch)
tree5ac92718aedee63653b701248a3e2d14e1523535 /scraper/qwant.php
parentbad8d7ad5062a7e346b6f2774159b8381420cdb7 (diff)
additional qwant error handling
Diffstat (limited to 'scraper/qwant.php')
-rw-r--r--scraper/qwant.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/scraper/qwant.php b/scraper/qwant.php
index 7f441e5..f914e15 100644
--- a/scraper/qwant.php
+++ b/scraper/qwant.php
@@ -659,6 +659,11 @@ class qwant{
throw new Exception("Qwant returned an API error");
}
+ if(isset($json["data"]["result"]["items"]["mainline"])){
+
+ throw new Exception("Qwant returned gibberish results");
+ }
+
$out = [
"status" => "ok",
"npt" => null,
@@ -754,6 +759,11 @@ class qwant{
throw new Exception("Qwant returned an API error");
}
+ if(isset($json["data"]["result"]["items"]["mainline"])){
+
+ throw new Exception("Qwant returned gibberish results");
+ }
+
$out = [
"status" => "ok",
"npt" => null,
@@ -856,6 +866,11 @@ class qwant{
throw new Exception("Qwant returned an API error");
}
+ if(isset($json["data"]["result"]["items"]["mainline"])){
+
+ throw new Exception("Qwant returned gibberish results");
+ }
+
$out = [
"status" => "ok",
"npt" => null,