fsu-fall2022-capstone / Project-Group-5

A discord bot that connects to the online game nationstates
1 stars 0 forks source link

Map rankings id to their category #30

Closed CoderJoshDK closed 1 year ago

CoderJoshDK commented 1 year ago

When responding to issues, an XML is returned with response data. Part of that is the change in rank stats. For example

<RANKINGS>
  <RANK id="5">
    <SCORE>35.38</SCORE>
    <CHANGE>0.03</CHANGE>
    <PCHANGE>0.084866</PCHANGE>
  </RANK>
</RANKINGS>

The rank id 5, for example, corresponds to the death rate. Part of properly handling formatted responses is formating the change in rank. It is part of the data people care about.
Instead of fetching the name every single time, it would be better to store that data in some mapping and reference it when needed.
To find what corresponds to what, you can use this link https://www.nationstates.net/page=list_nations?censusid=5; just make sure to replace the 5 in this example, with whatever id you need.

CoderJoshDK commented 1 year ago

Images are labeled id.png in /data/ranks/ Will close on PR