From 20709f327345010469dbf370dd60e32fd97c6278 Mon Sep 17 00:00:00 2001 From: garret Date: Tue, 2 Jul 2024 16:10:48 +0100 Subject: only do schizo alert if they're actually schizo most of the time it's just >no posts it seems --- fetch-status.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'fetch-status.py') diff --git a/fetch-status.py b/fetch-status.py index 26bfb56..9aa2480 100755 --- a/fetch-status.py +++ b/fetch-status.py @@ -35,12 +35,18 @@ profile_post = soup.find("div", attrs={ "data-lb-id": re.compile(r"profile\-post\-\d+") }) +is_loginwall = soup.find("html", class_='has-no-js template-login') != None if profile_post is None: print("Content-Type: text/plain; charset=utf-8") - print("Status: 403") - print() - print("🚨🚨🚨 schizo alert! 🚨🚨🚨") - print("it won't work if you don't expose your profile to the public, sorry") + if is_loginwall: + print("Status: 403") + print() + print("🚨🚨🚨 schizo alert! 🚨🚨🚨") + print("it won't work if you don't expose your profile to the public, sorry") + else: + print("Status: 500") + print() + print("it didn't work for some reason, possibly you don't have any posts on your profile") quit() print("Content-Type: text/html; charset=utf-8") -- cgit v1.2.3-70-g09d2