diff --git a/src/poller.py b/src/poller.py index 07c4d74..bf74367 100644 --- a/src/poller.py +++ b/src/poller.py @@ -96,13 +96,17 @@ def fetch_and_relay_post(post_url: str) -> bool: try: api = Api() - # Fetch the specific post - post = api.pull_status(post_id) - if post: - return process_single_post(post, username) - else: - print(f"Post not found: {post_id}", file=sys.stderr) - return False + # Fetch user's statuses and find the matching post + print(f"Fetching statuses for @{username} to find post {post_id}...") + statuses = list(api.pull_statuses(username, replies=True)) + + for post in statuses: + if str(post.get("id", "")) == post_id: + print(f"Found post {post_id}") + return process_single_post(post, username) + + print(f"Post not found in recent statuses: {post_id}", file=sys.stderr) + return False except Exception as e: print(f"Error fetching post: {e}", file=sys.stderr) return False