Skip to content

Instantly share code, notes, and snippets.

@yawboakye
Last active August 26, 2023 19:26
Show Gist options
  • Save yawboakye/6080738 to your computer and use it in GitHub Desktop.
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
#!/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