OsrsEx v0.1.0 OsrsEx.Hiscores View Source
For working with the Jagex Hiscores API.
It is EXTREMELY important to note that this module transforms the data
it recieves from the Jagex Hiscores API. The Jagex Hiscores API will
randomly return either -1
or the true level/xp/score when a player is
unranked in that skill or activity. OsrsEx.Hiscores
formats the incoming
data so that if a skill or activity hiscore is unranked, the values that go
with that are the absolute minimum. This means 0
for activty scores and
skill xp, and 1
for skill levels (10
for :hitpoints
).
Link to this section Summary
Functions
Fetches a player’s hiscores from the Jagex Hiscore API
Takes a raw Jagex Hiscore API response and transforms it
into a OsrsEx.Hiscores.Hiscore
Gives the raw url to a player’s hiscores
Link to this section Functions
fetch_hiscore(String.t()) :: {:ok, OsrsEx.Hiscores.Hiscore.t()} | {:error, :player_not_found} | {:error, :bad_api_response} | {:error, :bad_hiscores_format} | {:error, HTTPoison.Error.t()}
Fetches a player’s hiscores from the Jagex Hiscore API.
Results in a tuple containing the status :ok
or :error
and the appropriate result with the status.
A Hiscore is retrievable from {:ok, %OsrsEx.Hiscores.Hiscore{...}}
new(String.t()) :: {:ok, OsrsEx.Hiscores.Hiscore.t()} | {:error, :bad_hiscores_format}
Takes a raw Jagex Hiscore API response and transforms it
into a OsrsEx.Hiscores.Hiscore
.
Gives the raw url to a player’s hiscores.