jayvan / tempest-watch

Track active tempests in Path of Exile
zlib License
7 stars 5 forks source link

API discussion #21

Closed pajlada closed 9 years ago

pajlada commented 9 years ago

In the current_tempests endpoint (http://poetempest.com/api/v1/current_tempests), the base+suffix are returned as the description of the affixes, whereas for the vote endpoint, it requires me to pass through the affix name.

This makes it a lot trickier than necessary. I have multiple options here:

In my opinion, the current_tempests endpoint should return the prefix and suffix name, like this:

{
  "crypt": {
    "name": "Abyssal Tempest of Animation",
    "base": "abyssal",
    "suffix": "animation",
    "votes": 18,
    "type": "dangerous"
  },
  "desert": {
    "name": "Unknown Tempest",
    "base": "",
    "suffix": "",
    "votes": 0,
    "type": ""
  }
}

If we require the tempest description, we can easily match the affixes given to us with the data received from the tempests endpoint

jayvan commented 9 years ago

Makes complete sense to me.

kjy112 commented 9 years ago

I wanted to add my comment on this but this was closed. Perhaps, add two more fields to the object with instance 'base desc' and suffix desc' along with this change?

pajlada commented 9 years ago

My idea was that you can fetch tempest descriptions from here: http://poetempest.com/api/v0/tempests and match affix names yourself, just as you do with map and their levels (http://poetempest.com/api/v0/maps)

kjy112 commented 9 years ago

That works as well.

jayvan commented 9 years ago

Yeah, since the descriptions rarely change, I think it's best to keep them in the separate tempests API call, you can make it once and store them in a dictionary. Keeps the current tempest responses much shorter.