diff options
author | garret <garret@airmail.cc> | 2024-07-04 16:01:04 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2024-07-04 16:01:04 +0100 |
commit | fa18ed0238c23310c040c5d374d85b7938596734 (patch) | |
tree | 5e14a9ded4beacea167c3259d43775836ea0e814 | |
parent | d68b1760adcd20d1d2f8c5377f860849fc9bf304 (diff) | |
download | agora-status-fa18ed0238c23310c040c5d374d85b7938596734.tar.gz agora-status-fa18ed0238c23310c040c5d374d85b7938596734.tar.bz2 agora-status-fa18ed0238c23310c040c5d374d85b7938596734.zip |
don't compile the profile-post regex every time
might be a good idea.....
-rwxr-xr-x | fetch-status.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |