From 0233eaab2dd10ed6dd06fff894fd9b166568062b Mon Sep 17 00:00:00 2001 From: garret Date: Tue, 2 Jul 2024 15:56:26 +0100 Subject: initial commit hoge --- fetch-status.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 fetch-status.py 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) -- cgit v1.2.3-70-g09d2