From 52ce2f247ec3b9db1f14093e092cce9a5a9aa8a9 Mon Sep 17 00:00:00 2001 From: garret Date: Tue, 2 Jul 2024 17:07:56 +0100 Subject: set user agent so admin knows what this is, and who's actually requesting it a --- fetch-status.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'fetch-status.py') diff --git a/fetch-status.py b/fetch-status.py index c872a71..684ee9a 100755 --- a/fetch-status.py +++ b/fetch-status.py @@ -8,7 +8,11 @@ import os profile_id = os.environ['QUERY_STRING'].strip() -profile_html = requests.get("https://forum.agoraroad.com/index.php?members/" + profile_id).text +headers = { + 'User-Agent': f'agora status fetcher - contact forum user "garret 427738" or https://427738.xyz/hate-mail.html - requested by {os.environ.get("REMOTE_ADDR")}', +} + +profile_html = requests.get("https://forum.agoraroad.com/index.php?members/" + profile_id, headers=headers).text soup = BeautifulSoup(profile_html, 'lxml') profile_post = soup.find("div", attrs={ -- cgit v1.2.3-70-g09d2