Web Apps

New Ryzom API

Right, I am not a py programmer so C or assembler would do better for me ;),... I would even take Fortran or Pascal.

I am trying to get all items and details in inventory for a toon, then massage it into something magical.

I have been able to get it using this:
import sys
import xml.etree.ElementTree as ET
import requests
RYZ_API_ENDPOINT = "http://api.ryzom.com/character.php"
ryz_api_key = "abracadabraverylongcodewithnumbersandlettersstuff"
RYZ_PARAMS = {'apikey': ryz_api_key}
r = requests.get(url = RYZ_API_ENDPOINT, params = RYZ_PARAMS)
print(r.status_code == requests.codes.ok)
ryz_toon = ET.parse(r.text)
for elem in ryz_toon.iter():
 print ("%s: '%s'\n\r", elem.tag, elem.text)
Just wondered if there is a better, or pre-made set of libs.

Ultimately, not much different in C either.  there are libraries to get a HTTP/S responses back, and also XML parsers.
Show topic
Last visit Monday, 15 July 08:06:48 UTC

powered by ryzom-api