Code Monkey home page Code Monkey logo

the-division-open-gear-api's People

Contributors

creeation avatar mattberg11 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

krflol

the-division-open-gear-api's Issues

Localization of data

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. ๐Ÿข

"list.item.slots" should be a truthiness array

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)

Add usage examples

Current examples

  • Python
  • JavaScript

Feel free to suggest examples here or let everyone know you're working on one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.