|
|
|
@ -281,11 +281,11 @@ def post_tweet(author, tweet, reply_to_id=None): |
|
|
|
in_reply_to_tweet_id=reply_to_id |
|
|
|
in_reply_to_tweet_id=reply_to_id |
|
|
|
) |
|
|
|
) |
|
|
|
# Log rate limit headers on success |
|
|
|
# Log rate limit headers on success |
|
|
|
if hasattr(client, 'session') and client.session.last_response: |
|
|
|
if hasattr(response, '_response') and response._response: # Access the underlying response |
|
|
|
rate_limit_headers = { |
|
|
|
rate_limit_headers = { |
|
|
|
"x-rate-limit-limit": client.session.last_response.headers.get("x-rate-limit-limit"), |
|
|
|
"x-rate-limit-limit": response._response.headers.get("x-rate-limit-limit"), |
|
|
|
"x-rate-limit-remaining": client.session.last_response.headers.get("x-rate-limit-remaining"), |
|
|
|
"x-rate-limit-remaining": response._response.headers.get("x-rate-limit-remaining"), |
|
|
|
"x-rate-limit-reset": client.session.last_response.headers.get("x-rate-limit-reset"), |
|
|
|
"x-rate-limit-reset": response._response.headers.get("x-rate-limit-reset"), |
|
|
|
} |
|
|
|
} |
|
|
|
logging.debug(f"Rate limit headers after posting for {username}: {rate_limit_headers}") |
|
|
|
logging.debug(f"Rate limit headers after posting for {username}: {rate_limit_headers}") |
|
|
|
else: |
|
|
|
else: |
|
|
|
|