#!/usr/bin/env python3 import re from bs4 import BeautifulSoup import requests import os profile_id = os.environ['QUERY_STRING'].strip() 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={ "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)