creeation / the-division-open-gear-api Goto Github PK
View Code? Open in Web Editor NEW[on-hold] Open API & data source for gear data and attributes in The Division 2.
License: MIT License
[on-hold] Open API & data source for gear data and attributes in The Division 2.
License: MIT License
Are we thinking just some JSON files?
I think items should be enumerated. Its also not a very clear key name. Something like 'slots' would be better imo.
for slot in slots:
is a lot more descriptive than
for item in items:
as an example
Originally posted by @krflol in #2 (comment)
As of right now, there are JSON files composed of a list
array, where each item
has a label
.
What would be a good way to easily add translations later on?
Make label
an object:
{
"id": "511_tactical",
"label": {
"en": "5.11 Tactical",
"de": "5.11 Tactical",
"fr": "5.11 Tactical",
"cz": "5.11 Tactical"
},
"items": ["masks", "vests", "backpacks", "gloves", "holsters", "kneepads"]
}
Or name it labels
and make it an array of objects with country codes like this for easier filtering:
{
"id": "511_tactical",
"labels": [
{ "en": "5.11 Tactical" },
{ "de": "5.11 Tactical" },
{ "fr": "5.11 Tactical" },
{ "cz": "5.11 Tactical" }
],
"items": ["masks", "vests", "backpacks", "gloves", "holsters", "kneepads"]
}
I'm not sure, but I personally like arrays, e.g. the second proposal more.
Please discuss below. ๐ข
Furthermore, slots should probably be a truthiness array for the future. pseudocode follows to combine the enum, unique id, and truthiness
psuedojson:
{
'id': 511 //unique id. 511 tactical
'slots': {
0: True //lets call this gloves for example
1: False // chest for example
...
101: False // cosmetics. lets call this hat.
102: False// costmetics again. lets say face
...
etc
}
from the_division_api import slots, ids
import requests
my_json = requests.get(division_data_endpoint.com)
for item in my_json:
if item.slots[slots.glove]:
print(f'you have found a glove! {item.label}, the id for this item is {item.id}')
Originally posted by @krflol in #2 (comment)
Feel free to suggest examples here or let everyone know you're working on one.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.