Skip to content

Instantly share code, notes, and snippets.

Created June 1, 2012 05:17
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 anonymous/2849052 to your computer and use it in GitHub Desktop.
Save anonymous/2849052 to your computer and use it in GitHub Desktop.
http.start do |http|
request = Net::HTTP::Post.new(LOGIN_PATH, headers)
request.body = {"cpusername" => USERNAME, "cppassword" => PASSWORD}.to_json
response = http.request(request)
if response.code == "200"
gameserver = Net::HTTP::Get.new(GAME_SERVER_PATH, headers)
response = http.request(gameserver)
if response.code == "200"
pp response.body
end
end
print_error(response)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment