originally posted in:BungieNetPlatform
View Entire Topic
Hello everyone
i am wondering if XUR has fixed 'eventHash' which is 5 or use 'eventIdentifier' which is "SPECIAL_EVENT_BLACK_MARKET"
because i want to check if Xur is available
English
#Help
-
Here is how I do it in Python The check: if eventHash == "SPECIAL_EVENT_BLACK_MARKET": xurItemList, xurItemHash = getXurItems() else: xur = None The get: def getXurItems (): url = "https://www.bungie.net/platform/Destiny/Advisors/Xur/" r = requests.get(url, headers=apiheaders) xurManifest = r.json() xurItemsList = [] xurItemsHash = [] if xurManifest['ErrorCode'] != 1: xurItemsList = ["Xur recalled"] else: xurItemHashID = [xurManifest['Response']['data']['saleItemCategories'][2]['saleItems'][i]['item']['itemHash'] for i in range(0, 5)] for i in range(len(xurItemHashID)): xurItemsList.append(getInventoryItem(xurItemHashID[i])) xurItemsHash.append(xurItemHashID[i]) return (xurItemsList, xurItemsHash)