Created
October 14, 2024 15:19
-
-
Save slavingia/dbb18741e82d4d57579910491e05c47b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
# https://x.com/shl/status/926024538 | |
# Found via https://x.com/search?q=from%3Ashl%20until%3A2008-09-19&src=typed_query&f=live | |
# Define dates | |
first_tweet_date = datetime.date(2008, 9, 18) | |
today = datetime.date.today() | |
birth_date = datetime.date(1992, 8, 25) | |
# Calculate total days lived and days since first tweet | |
total_days_lived = (today - birth_date).days | |
days_since_first_tweet = (today - first_tweet_date).days | |
days_not_tweeting = total_days_lived - days_since_first_tweet | |
# Calculate percentage | |
percentage = (days_since_first_tweet / total_days_lived) * 100 | |
print(f"Days alive: {total_days_lived}") | |
print(f"Days tweeting: {days_since_first_tweet}") | |
print(f"Days not tweeting: {days_not_tweeting}") | |
print(f"Percentage of life spent tweeting: {percentage:.2f}%") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Javascript version to run it in Browser's console quickly: