|
|
|
@ -22,16 +22,23 @@ def display_author_status(author): |
|
|
|
can_post, remaining, reset = check_author_rate_limit(author) |
|
|
|
can_post, remaining, reset = check_author_rate_limit(author) |
|
|
|
reset_time = datetime.fromtimestamp(reset, tz=timezone.utc).strftime('%Y-%m-%d %H:%M:%S') |
|
|
|
reset_time = datetime.fromtimestamp(reset, tz=timezone.utc).strftime('%Y-%m-%d %H:%M:%S') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get detailed API status first |
|
|
|
|
|
|
|
api_remaining, api_reset = get_x_rate_limit_status(author) |
|
|
|
|
|
|
|
if api_remaining is not None: |
|
|
|
|
|
|
|
api_reset_time = datetime.fromtimestamp(api_reset, tz=timezone.utc).strftime('%Y-%m-%d %H:%M:%S') |
|
|
|
|
|
|
|
# Use API values as primary display |
|
|
|
|
|
|
|
remaining = api_remaining |
|
|
|
|
|
|
|
reset_time = api_reset_time |
|
|
|
|
|
|
|
can_post = remaining > 0 |
|
|
|
|
|
|
|
|
|
|
|
status = "✅" if can_post else "❌" |
|
|
|
status = "✅" if can_post else "❌" |
|
|
|
print(f"\n{status} {username}:") |
|
|
|
print(f"\n{status} {username}:") |
|
|
|
print(f" • Remaining tweets: {remaining}/17") |
|
|
|
print(f" • Remaining tweets: {remaining}/17") |
|
|
|
print(f" • Reset time: {reset_time}") |
|
|
|
print(f" • Reset time: {reset_time}") |
|
|
|
print(f" • Can post: {'Yes' if can_post else 'No'}") |
|
|
|
print(f" • Can post: {'Yes' if can_post else 'No'}") |
|
|
|
|
|
|
|
|
|
|
|
# Get detailed API status |
|
|
|
# Show API status for verification |
|
|
|
api_remaining, api_reset = get_x_rate_limit_status(author) |
|
|
|
|
|
|
|
if api_remaining is not None: |
|
|
|
if api_remaining is not None: |
|
|
|
api_reset_time = datetime.fromtimestamp(api_reset, tz=timezone.utc).strftime('%Y-%m-%d %H:%M:%S') |
|
|
|
|
|
|
|
print(f" • API Status: {api_remaining} remaining, resets at {api_reset_time}") |
|
|
|
print(f" • API Status: {api_remaining} remaining, resets at {api_reset_time}") |
|
|
|
|
|
|
|
|
|
|
|
def display_total_capacity(): |
|
|
|
def display_total_capacity(): |
|
|
|
@ -46,6 +53,12 @@ def display_total_capacity(): |
|
|
|
|
|
|
|
|
|
|
|
for author in AUTHORS: |
|
|
|
for author in AUTHORS: |
|
|
|
can_post, remaining, _ = check_author_rate_limit(author) |
|
|
|
can_post, remaining, _ = check_author_rate_limit(author) |
|
|
|
|
|
|
|
# Get API status for accurate count |
|
|
|
|
|
|
|
api_remaining, _ = get_x_rate_limit_status(author) |
|
|
|
|
|
|
|
if api_remaining is not None: |
|
|
|
|
|
|
|
remaining = api_remaining |
|
|
|
|
|
|
|
can_post = remaining > 0 |
|
|
|
|
|
|
|
|
|
|
|
used = 17 - remaining |
|
|
|
used = 17 - remaining |
|
|
|
total_used += used |
|
|
|
total_used += used |
|
|
|
if can_post: |
|
|
|
if can_post: |
|
|
|
|