Showing Posts For Leylin.3901:

[How to] Get chat code with item ID

in API Development

Posted by: Leylin.3901

Leylin.3901

Hello there,

I don’t know if it is okay to revive this long dead thread. But the thing that you were afraid about happened: There are Item ID’s higher than 65535.

I used the python code snippet from zeeZ.5713 and modified it to fit into my environment:

def genItemChatCode(item_id):
a = b’\x02\x01’ + bytes([item_id % 256]) + bytes([int(item_id / 256)]) + b’\x00\x00’
return ‘[&’ + b64encode(a).decode(encoding=“UTF-8”) + ‘]’

It was working really well – until I reached “Item: 65536 Ascalonian Elementalist Loot Box”.

After a bit of searching I stumbled across a little python gem from “Guest”:
http://pastebin.com/Nkw5iZGv

I modified it and used it with Python 3.3.2 and Django 1.6 as a template filter.

@register.filter
def genItemChatCode(item_id):
– - hexa = b’\x02\x01’
– - for i in range(4):
– - – - hexa += bytes([item_id % 256])
– - – - item_id //= 256
– - return ‘[&’ + b64encode(hexa).decode(encoding=“UTF-8”) + ‘]’

I hope this helps

(edited by Leylin.3901)

[API Suggestion] Items, Recipes, and Crafting

in API Development

Posted by: Leylin.3901

Leylin.3901

I hope I am in the correct place to add a suggestion for the skin_details.

It would be great to have an attribute skinset or something like that.

This way you could group the skins by their set (for example: all embroidered items). Currently I am missing this option in the game as well as in the API.

Until this is implemented (if it will be) there is no other way than to take all but the last word of the skin as name of the skin set.

Has anyone experienced if this approach is more or less reliable?
Has anyone another idea to get the name of the skin sets?

API errors & bugs

in API Development

Posted by: Leylin.3901

Leylin.3901

Missing skin with id=1053. Related item is “item_id=39532”

https://api.guildwars2.com/v1/skin_details.json?skin_id=1053
returns:
{"error": 10, “product” : 71, “module”: 2, “line”: 314, “text”: null}

Edit:
Like Dr Ishmael said, there are a lot more skins missing. So far I have a list of 100 skin_ids that don’t have a json-string for the details:

3689 3265 3245 3244 3242 3241 3192 3190 3188 3187 3186 2809 2775 2743 2434 2399 2398 2396 2395 2392 2391 2389 2388 2387 2385 2384 2339 2329 2327 2326 2325 2318 2009 1763 1570 1249 1248 1247 1233 1218 1217 1215 1214 1213 1212 1211 1194 1193 1183 1182 1181 1180 1179 1178 1177 1176 1175 1174 1173 1171 1168 1167 1166 1165 1164 1161 1159 1158 1150 1149 1148 1147 1142 1133 1118 1117 1115 1114 1112 1110 1109 1108 1088 1083 1080 1078 1076 1073 1070 1068 1067 1065 1063 1061 1059 1058 1056 1055 1054 1053

(edited by Leylin.3901)