Skip to content

Instantly share code, notes, and snippets.

@troyscott
Created October 6, 2012 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save troyscott/3845703 to your computer and use it in GitHub Desktop.
Save troyscott/3845703 to your computer and use it in GitHub Desktop.
Lord of Ultima Python Script
#!/usr/bin/env python
import httplib2
from urllib import urlencode
import json
url_login = "https://www.lordofultima.com/en/user/login"
url_main = "http://prodgame05.lordofultima.com/197/"
url_game = "%sindex.asp" % (url_main)
url_ajax = "%sPresentation/Service.svc/ajaxEndpoint/" % (url_main)
url_server_info = "%sGetServerInfo" % (url_ajax)
sessionId = ""
user_mail = ""
user_password = ""
content_type = {'content-type':'application/json'}
def login():
h = httplib2.Http()
data = dict(mail=user_mail, password=user_password)
resp = h.request(url_login, urlencode(data))
return resp
def getSessionId():
pass
def getServerInfo():
h = httplib2.Http()
data = '{"session":"%s"}' % sessionId
data = json.dumps({"session": sessionId})
resp = h.request(url_server_info, "POST", body=data, headers=content_type)
return resp
if __name__ == "__main__":
print 'Test Module ....'
print getServerInfo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment