From 3763742c7a99021556f1ca0317894240225fda05 Mon Sep 17 00:00:00 2001 From: EthanC <16727756+EthanC@users.noreply.github.com> Date: Tue, 5 Mar 2024 01:04:17 -0600 Subject: [PATCH] Fix and document minimum cooldown time option --- .env.example | 3 ++- README.md | 6 ++++-- bluebird.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 220a0fa..3696b78 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,8 @@ LOG_DISCORD_WEBHOOK_LEVEL=WARNING USERS_ALL=Mxtive,spectatorindex,Breaking911 USERS_TOP=X,XData USERS_MEDIA=archillect -COOLDOWN_MAX_TIME=60 +COOLDOWN_MIN_TIME=60 +COOLDOWN_MAX_TIME=300 X_CSRF_TOKEN=XXXXXXXX X_AUTH_TOKEN=XXXXXXXX X_BEARER_TOKEN=XXXXXXXX diff --git a/README.md b/README.md index 9056b1d..abba5be 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ An X account is required. It is recommended to use a throwaway account due to us - `USERS_ALL`: Comma-separated list of [X](https://x.com/) usernames to monitor for all posts. - `USERS_TOP`: Comma-separated list of [X](https://x.com/) usernames to monitor for top-level posts only. - `USERS_MEDIA`: Comma-separated list of [X](https://x.com/) usernames to monitor for media posts only. -- `COOLDOWN_MAX_TIME`: Maximum randomized cooldown time between checking for new posts (default is 60). +- `COOLDOWN_MIN_TIME`: Minimum randomized cooldown time between checking for new posts (default is 60). +- `COOLDOWN_MAX_TIME`: Maximum randomized cooldown time between checking for new posts (default is 300). - `X_CSRF_TOKEN`: CSRF Token obtained via request inspection on X. - `X_AUTH_TOKEN`: Cookie Auth Token obtained via request inspection on X. - `X_BEARER_TOKEN`: Authentication Bearer Token obtained via request inspection on X. @@ -40,7 +41,8 @@ services: USERS_ALL: Mxtive,spectatorindex,Breaking911 USERS_TOP: X,XData USERS_MEDIA: archillect - COOLDOWN_MAX_TIME: 60 + COOLDOWN_MIN_TIME: 60 + COOLDOWN_MAX_TIME: 300 X_CSRF_TOKEN: XXXXXXXX X_AUTH_TOKEN: XXXXXXXX X_BEARER_TOKEN: XXXXXXXX diff --git a/bluebird.py b/bluebird.py index b796762..e1e4c88 100644 --- a/bluebird.py +++ b/bluebird.py @@ -109,7 +109,7 @@ def WatchPosts( while True: # Randomize cooldown to mimic natural behavior. - cooldownMin: int = int(environ.get("COOLDOWN_MAX_TIME", 60)) + cooldownMin: int = int(environ.get("COOLDOWN_MIN_TIME", 60)) cooldownMax: int = int(environ.get("COOLDOWN_MAX_TIME", 300)) cooldown: int = randint(cooldownMin, cooldownMax)