Skip to content

Instantly share code, notes, and snippets.

@orlp
Created May 2, 2012 06:34
Show Gist options
  • Select an option

  • Save orlp/2574477 to your computer and use it in GitHub Desktop.

Select an option

Save orlp/2574477 to your computer and use it in GitHub Desktop.
import urllib2
import json
def authenticate(region, username, password):
authenticate_urls = {
"euw": "https://lq.eu.lol.riotgames.com/login-queue/rest/queue/authenticate",
"eun": "https://lq.eun1.lol.riotgames.com/login-queue/rest/queue/authenticate",
"na": "https://lq.na1.lol.riotgames.com/login-queue/rest/queue/authenticate"
}
request = urllib2.Request(authenticate_urls[region], "payload=user=%s,password=%s" % (username, password))
return json.loads(urllib2.urlopen(request).read())
print(authenticate("euw", "nightcracker", "***********"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment