From 1fa53461d5741d412df1c866ea87bc6e29935350 Mon Sep 17 00:00:00 2001 From: garret Date: Tue, 2 Jul 2024 16:01:20 +0100 Subject: show an error message if the posts/profile isnt accessible mostly this happens because the forum software says "you have to be logged in to do that" so that's why the error message is what it is, but i think it might be catching things it shouldnt --- fetch-status.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fetch-status.py') diff --git a/fetch-status.py b/fetch-status.py index 1c0522d..26bfb56 100755 --- a/fetch-status.py +++ b/fetch-status.py @@ -35,6 +35,14 @@ profile_post = soup.find("div", attrs={ "data-lb-id": re.compile(r"profile\-post\-\d+") }) +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") + quit() + print("Content-Type: text/html; charset=utf-8") print() print(profile_post) -- cgit v1.2.3-70-g09d2