Advertisement
Guest User

Minecraft Resolver Coded By ADHD

a guest
Nov 27th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.40 KB | None | 0 0
  1. import urllib2
  2. import re
  3. print "---------------------------------"
  4. print "The Minecraft Resolver"
  5. print "Coded By ADHD"
  6. print "---------------------------------"
  7. print "[1]Username to UUID"
  8. print "[2]UUID to Username"
  9. print "---------------------------------"
  10. choice = raw_input("What would you like to do?:")
  11. print "---------------------------------"
  12. if choice == "1":
  13.     username = raw_input("Username:")
  14.     uuidurl = "https://api.mojang.com/users/profiles/minecraft/" + username
  15.     infoname = urllib2.urlopen(uuidurl).read(40)
  16.     infoname = re.sub('[{"id"]', '', infoname)
  17.     UUIDText = "UUID" + infoname
  18.     print "---------------------------------"
  19.     if UUIDText == "UUID" : print "Error try again!"
  20.     print(UUIDText)
  21.     print "---------------------------------"
  22. elif choice == "2":
  23.     uuid = raw_input("UUID:")
  24.     usernameurl = "https://api.mojang.com/user/profiles/" + uuid + "/names"
  25.     infouuid = urllib2.urlopen(usernameurl).read()
  26.     infouuid = re.sub('["]', '', infouuid)
  27.     UsernameText = "Username:" + infouuid
  28.     print "---------------------------------"
  29.     if UsernameText == "Username:" :
  30.         print "Error try again!"
  31.     else :
  32.         print(UsernameText)
  33.     print "---------------------------------"
  34. else :
  35.     print "That is not a valid choice!"
  36.     print "---------------------------------"
  37.    
  38. ###Contact me on my XMPP: adhd@dukgo.com ###
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement