Skip to content

Instantly share code, notes, and snippets.

@marlhammer
Last active August 29, 2015 14:25
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 marlhammer/4e6789078ace54692562 to your computer and use it in GitHub Desktop.
Save marlhammer/4e6789078ace54692562 to your computer and use it in GitHub Desktop.
import httplib2
import json
# Parameters:
#
character_name = "Marlhammer"
server = "Khadgar"
# Script:
#
base_url="http://us.battle.net/api/wow/character/"
base_url+=server
base_url+="/"
base_url+=character_name
base_url+="?fields=achievements,appearance,mounts,pets,professions,progression,pvp,quests,reputation,stats,talents,titles"
resp, content = httplib2.Http().request(base_url)
output = open(character_name + '.json', 'w')
character_json = json.loads(content)
json.dump(character_json, output, sort_keys=True, indent=4, separators=(',', ': '))
output.write("\n")
for achievement in character_json["achievements"]["achievementsCompleted"]:
resp, content = httplib2.Http().request("http://us.battle.net/api/wow/achievement/"+str(achievement))
achievement_json = json.loads(content)
json.dump(achievement_json, output, sort_keys=True, indent=4, separators=(',', ': '))
output.write("\n")
print str(achievement)
print "\nCompleted!\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment