diff options
| author | lolcat <will@lolcat.ca> | 2026-06-14 16:07:33 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-06-21 14:54:20 -0700 |
| commit | 901c4d0897d0486db8e94bee244ab1728e4ed3d1 (patch) | |
| tree | ebcbdaf8a2b4c40b51d509105c863a538c3c750f /scraper | |
| parent | cc84112decb77d1f0f5de2cc43a5bc6ec709fad4 (diff) | |
Diffstat (limited to 'scraper')
| -rw-r--r-- | scraper/marginalia.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scraper/marginalia.php b/scraper/marginalia.php index 90b7f4c..ee18cc0 100644 --- a/scraper/marginalia.php +++ b/scraper/marginalia.php @@ -289,8 +289,18 @@ class marginalia{ throw new Exception("The API key used is rate limited. Please try again in a few minutes."); } + if(strpos($json, "<title>Bad Gateway (502)</title>")){ + + throw new Exception("Marginalia returned a 502 error"); + } + $json = json_decode($json, true); + if($json === null){ + + throw new Exception("Failed to decode JSON"); + } + foreach($json["results"] as $result){ $out["web"][] = [ |
