-->
0 Members and 1 Guest are viewing this topic.
#!/usr/bin/pythonimport httplib2from xml.etree import ElementTree as ETREQUEST_URL = "http://education.ti.com/ws/webUpdate/queryForUpdate"root = ET.Element("QueryUpdates")Request = ET.SubElement(root, "Request")WebUpdateClientName = ET.SubElement(Request, "WebUpdateClientName")WebUpdateClientVersion = ET.SubElement(Request, "WebUpdateClientVersion")WebUpdateClientOS = ET.SubElement(Request, "WebUpdateClientOS")CurrentVersion = ET.SubElement(Request, "CurrentVersion")LanguageCode = ET.SubElement(Request, "LanguageCode")WebUpdateClientEncoding = ET.SubElement(Request, "WebUpdateClientEncoding")RequestType = ET.SubElement(Request, "RequestType")CalculatorModel = ET.SubElement(Request, "CalculatorModel")WebUpdateClientName.text = "TI-Nspire Computer Link Software"WebUpdateClientVersion.text = "1.4.0.539"WebUpdateClientOS.text = "Linux"CurrentVersion.text = "3.1.0.392"LanguageCode.text = "NL"WebUpdateClientEncoding.text = "ISO-8859-1"RequestType.text = "OS"CalculatorModel.text = "TI-Nspire"bodyrequest=ET.tostring(root)h = httplib2.Http(".cache")resp, content = h.request(REQUEST_URL,"POST", body=bodyrequest)root = ET.XML(content)Response = root[1]ProductInfo = Response[1]for node in ProductInfo: name = node.__str__().split("\'")[1] if node.text: print(name + ": " + node.text)