aboutsummaryrefslogtreecommitdiffstats
path: root/scraper/marginalia.php
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2026-06-14 16:07:33 -0400
committerlolcat <will@lolcat.ca>2026-06-14 16:07:33 -0400
commit5a7cecef11d4b728ba202e1a80f5a77b7aee88fe (patch)
treefd8e3ebaf451d3bbfd3b10f84386d4de4141d519 /scraper/marginalia.php
parentd87bac94b5290fb49ba97e97d805caa3a93ef569 (diff)
marginalia api 502
Diffstat (limited to 'scraper/marginalia.php')
-rw-r--r--scraper/marginalia.php10
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"][] = [
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage