Skip to content

Instantly share code, notes, and snippets.

@candu
Created May 25, 2013 04:21
Show Gist options
  • Save candu/5647896 to your computer and use it in GitHub Desktop.
Save candu/5647896 to your computer and use it in GitHub Desktop.
Brute-forcing Racer Chrome experiment codes. (Unfortunately, the chance of getting a valid code is pretty small.)
import json
import string
import urllib
import sys
import random
chars = string.uppercase
while True:
s = ''.join(random.choice(chars) for i in range(5))
try:
url = 'http://chrome.com/racer/control/join?gameId={0}'.format(s)
f = urllib.urlopen(url)
data = json.loads(f.read())
print s
if data:
sys.exit(0)
except IOError:
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment