From fa18ed0238c23310c040c5d374d85b7938596734 Mon Sep 17 00:00:00 2001 From: garret Date: Thu, 4 Jul 2024 16:01:04 +0100 Subject: don't compile the profile-post regex every time might be a good idea..... --- fetch-status.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fetch-status.py') diff --git a/fetch-status.py b/fetch-status.py index 9cb4be3..d87d6b8 100755 --- a/fetch-status.py +++ b/fetch-status.py @@ -34,6 +34,8 @@ posts = soup.find_all("div", class_="message-content js-messageContent") post_body = None +data_lb_id_regex = re.compile(r"profile\-post\-\d+") + for post in posts: posted_by_user = post.find("a", attrs={ "class": 'username', @@ -42,7 +44,7 @@ for post in posts: if posted_by_user: post_body = post.find("div", attrs={ "class": "lbContainer js-lbContainer", - "data-lb-id": re.compile(r"profile\-post\-\d+") + "data-lb-id": data_lb_id_regex, }) break -- cgit v1.2.3-70-g09d2