Guest User

Find available 3ch reddit usernames (fixed)

a guest
Jul 2nd, 2012
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2.  
  3. import httplib
  4. import string
  5.  
  6. def exists(username):
  7.   c = httplib.HTTPConnection("www.reddit.com")
  8.   c.request("HEAD", "/user/" + username)
  9.   r = c.getresponse().status
  10.   assert r in [200, 404], "WTF just happened?"
  11.   return r == 200
  12.  
  13. cc = string.ascii_lowercase + string.digits + "-_"
  14. all_3ch = set(x + y + z for x in cc for y in cc for z in cc)
  15.  
  16. for user in all_3ch:
  17.   if not exists(user):
  18.     print user
Advertisement
Add Comment
Please, Sign In to add comment