Last active
August 26, 2023 19:26
-
-
Save yawboakye/6080738 to your computer and use it in GitHub Desktop.
Which 3-letter handles are not owned on https://twitter.com? Doesn't mean you can have them
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
#!/usr/bin/env python3 | |
def fof(handle): | |
try: | |
twitter_conn = http.client.HTTPSConnection('twitter.com') | |
twitter_conn.connect() | |
twitter_conn.request('GET', '/{}'.format(handle)) | |
return twitter_conn.getresponse().status >= 400: | |
except: | |
return False | |
def run(): | |
unused_handles = { a+b+c for a in alphabets for b in alphabets for c in alphabets if fof(a+b+c) } | |
open('unused_handles.txt', 'w').write('\n'.join(unused_handles)) | |
if __name__ == '__main__': | |
# I tend to leave my import statements here. Don't ask me why | |
import http.client | |
from string import ascii_lowercase as alphabets | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment