diff options
author | garret <garret@airmail.cc> | 2024-07-02 16:10:48 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2024-07-02 17:34:41 +0100 |
commit | 20709f327345010469dbf370dd60e32fd97c6278 (patch) | |
tree | db149f496c6fb59479ff169ffe9a3f24afe327d3 /fetch-status.py | |
parent | 1fa53461d5741d412df1c866ea87bc6e29935350 (diff) | |
download | agora-status-20709f327345010469dbf370dd60e32fd97c6278.tar.gz agora-status-20709f327345010469dbf370dd60e32fd97c6278.tar.bz2 agora-status-20709f327345010469dbf370dd60e32fd97c6278.zip |
only do schizo alert if they're actually schizo
most of the time it's just >no posts it seems
Diffstat (limited to 'fetch-status.py')
-rwxr-xr-x | fetch-status.py | 14 |
1 files changed, 10 insertions, 4 deletions
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") |