Skip to content

Commit 7b3e662

Browse files
author
Trevor Phillips
authored
Updated game_data.py example (#21)
1 parent 3b768dd commit 7b3e662

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

examples/game_data.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,21 @@
1717

1818
# fetch token price for region
1919
api = WowApi(os.environ['WOW_CLIENT_ID'], os.environ['WOW_CLIENT_SECRET'])
20-
data = api.get_token('eu', namespace='dynamic-eu', locale='de_DE')
20+
data = api.get_token_index('eu', namespace='dynamic-eu', locale='de_DE')
2121
pprint(data)
2222

2323
# get realm list and request detail href with the get_data_resource method
24-
data = api.get_realms('us', namespace='dynamic-us')
24+
data = api.get_realm_index('eu', namespace='dynamic-eu', locale='de_DE')
2525
detail_url = data['realms'][0]['key']['href']
26-
detail_data = api.get_data_resource(detail_url, region='us')
26+
detail_data = api.get_data_resource(detail_url, region='eu', locale='de_DE')
2727
pprint(detail_data)
2828

2929
# get playable specializations list and fetch a single specialization with the api
30-
data = api.get_playable_specializations('us', namespace='static-us')
30+
data = api.get_playable_specialization_index(
31+
'eu', namespace='static-eu', locale='de_DE'
32+
)
3133
spec_id = data['character_specializations'][0]['id']
32-
specialization = api.get_playable_specialization('us', namespace='static-us', spec_id=spec_id)
34+
specialization = api.get_playable_specialization(
35+
'eu', namespace='static-eu', spec_id=spec_id, locale='de_DE'
36+
)
3337
pprint(specialization)

0 commit comments

Comments
 (0)