LodestonerEx v1.0.0 LodestonerEx.Client.FreeCompany
Provides functions that retrieve Free Company data.
Summary
Functions
Retrieves information for a Free Company
Retrieve the Lodestone ID of a Free Company
Retrives the membership roster of an FC
Functions
Retrieves information for a Free Company.
Parameters
lodestone_id
: The FC Lodestone ID as a string.
Returns
- See Example.
Raises
LodestonerEx.Client.ClientError
if any of the following occur:
- Lodestone returns a non-200 HTTP response.
Examples
iex> LodestonerEx.Client.FreeCompany.info!("9232238498621162014")
%{active: "Always", active_members: "501", estate_profile: nil,
focus: ["Role-playing", "Leveling", "Casual", "Hardcore", "Dungeons",
"Guildhests", "Trials", "Raids", "PvP"],
formed: %DateTime{calendar: Calendar.ISO, day: 24, hour: 20,
microsecond: {0, 0}, minute: 26, month: 8, second: 59, std_offset: 0,
time_zone: "Etc/UTC", utc_offset: 0, year: 2013, zone_abbr: "UTC"},
name: "MagiTaint Mayhem", rank: %{last_month: "7", last_week: "5", now: "8"},
recruitment: "Open",
seeking: ["Tank", "Healer", "DPS", "Crafter", "Gatherer"],
slogan: "A guild for lesbian/gay/bi/trans/ally folk. To join us, you *MUST* apply at rtgc.enjin.com/ffxiv and request membership. This app is ONLY a waitlist.",
tag: "«TAINT»"}
Retrieve the Lodestone ID of a Free Company.
Parameters
server_name
: The server or world name, e.g."Gilgamesh"
full_fc_name
: FC name in full, searching by tag doesn’t really work. e.g."Death and Taxes"
Returns
- String.t The lodestone ID.
Raises
LodestonerEx.Client.ClientError
if any of the following occur:
- Lodestone returns a non-200 HTTP response.
- No free companies are found by the search.
Multiple free companies are found by the search.
The last reason generally means that the exact name does not exist on that world/server. (Or that you
Examples
iex> LodestonerEx.Client.FreeCompany.lodestone_id!("Gilgamesh", "Well Crap")
** (LodestonerEx.Client.ClientError) Found no such FC.
iex> LodestonerEx.Client.FreeCompany.lodestone_id!("Gilgamesh", "Magitaint Mayhem")
"9232238498621162014"
Retrives the membership roster of an FC.
Note that this is a pretty heavy operation. Members are only shown
50 at a time, and Lodestone is notoriously slow. I’ve done my best by
spawning all the requests and parsing via Task.async/1
and reducing
the results. However, you’ll be opening a lot of connections, so
be careful.
Paramaters
lodestone_id
: The free company’s lodestone ID as a string.
Returns
A list of maps. See examples.
Examples
iex(14)> LodestonerEx.Client.FreeCompany.member_roster!("9232238498621162014") |> Enum.count
501
iex(15)> LodestonerEx.Client.FreeCompany.member_roster!("9232238498621162014") |> List.first
%{id: "6804197", name: "Alexander Valert",
rank: %{id: "2", name: "Spoony Bard"}}
iex(16)> LodestonerEx.Client.FreeCompany.member_roster!("9232238498621162014") |> List.last
%{id: "9295239", name: "Rijo Zaba", rank: %{id: "5", name: "InLovingMemory"}}