originally posted in:BungieNetPlatform
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
-
Yes, if you're looking in the specialEvents data that gets returned, both of these are true: both eventHash being 5 and eventIdentifier being SPECIAL_EVENT_BLACK_MARKET for Xur will always be the same!
-
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)