diff options
author | garret <garret@airmail.cc> | 2024-07-02 17:07:56 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2024-07-02 17:34:41 +0100 |
commit | 52ce2f247ec3b9db1f14093e092cce9a5a9aa8a9 (patch) | |
tree | 7a368857b3bb8c27e59de87af576ef598ba7d6b9 /fetch-status.py | |
parent | 0233eaab2dd10ed6dd06fff894fd9b166568062b (diff) | |
download | agora-status-52ce2f247ec3b9db1f14093e092cce9a5a9aa8a9.tar.gz agora-status-52ce2f247ec3b9db1f14093e092cce9a5a9aa8a9.tar.bz2 agora-status-52ce2f247ec3b9db1f14093e092cce9a5a9aa8a9.zip |
set user agent
so admin knows what this is, and who's actually requesting it
a
Diffstat (limited to 'fetch-status.py')
-rwxr-xr-x | fetch-status.py | 6 |
1 files changed, 5 insertions, 1 deletions
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={ |