diff options
author | garret <garret@airmail.cc> | 2024-07-02 15:56:26 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2024-07-02 15:58:13 +0100 |
commit | 0233eaab2dd10ed6dd06fff894fd9b166568062b (patch) | |
tree | f0ec0773803fa6e748b3a8d35e7c24bcb526ed89 /fetch-status.py | |
download | agora-status-0233eaab2dd10ed6dd06fff894fd9b166568062b.tar.gz agora-status-0233eaab2dd10ed6dd06fff894fd9b166568062b.tar.bz2 agora-status-0233eaab2dd10ed6dd06fff894fd9b166568062b.zip |
initial commit
hoge
Diffstat (limited to 'fetch-status.py')
-rwxr-xr-x | fetch-status.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fetch-status.py b/fetch-status.py new file mode 100755 index 0000000..c872a71 --- /dev/null +++ b/fetch-status.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +import re + +from bs4 import BeautifulSoup +import requests + +import os + +profile_id = os.environ['QUERY_STRING'].strip() + +profile_html = requests.get("https://forum.agoraroad.com/index.php?members/" + profile_id).text +soup = BeautifulSoup(profile_html, 'lxml') + +profile_post = soup.find("div", attrs={ + "class": "lbContainer js-lbContainer", + "data-lb-id": re.compile(r"profile\-post\-\d+") +}) + +print("Content-Type: text/html; charset=utf-8") +print() +print(profile_post) |