nodestone
v0.3.6
Published
A Node.JS Lodestone scraper for FFXIV apps
Downloads
15
Readme
Nodestone
A scraper utility for accessing data from the Final Fantasy XIV Lodestone. Functions mostly on regular expressions and duct tape.
Install: npm install nodestone
Interface
Status
Signature: ns.Status() => Promise<Object, Error>
Retrieve the current server status.
Resolves to an object containing keys for all worlds by name, and gateway
for the gateway/login server. Each key contains an object of the form {"status": boolean, "maintenance": Timer || null}
. Rejects with an Error object with a message that may even be appropriate.
Characters
Signature: ns.Character(string || object) => Promise<Object, Error>
Retrieve a character from the Lodestone by their ID. If you pass an object instead of an ID string, the id
field of that object will be used. You can also pass an array with precisely one object, and the same behaviour will be exhibited.
Resolves to a JSON document (matching the format shown below) of the character's information, or rejects with an Error indicating what went wrong.
{
"id": "2257085",
"name": "Serah Kreiss",
"server": "Goblin",
"title": "Duelist",
"freecompany": {
"id": "9234771773411585379",
"name": "Company Of Heroes"
},
"classes": {
"PLD": 26,
"MNK": 52,
"WAR": 60,
"DRG": 15,
"BRD": 21,
"NIN": 60,
"WHM": 60,
"BLM": 60,
"SMN": 60,
"SCH": 60,
"DRK": 45,
"MCH": 0,
"AST": 60,
"CRP": 60,
"BSM": 60,
"ARM": 60,
"GSM": 60,
"LTW": 60,
"WVR": 60,
"ALC": 60,
"CUL": 60,
"MIN": 60,
"BTN": 60,
"FSH": 60
},
"grandcompany": {
"name": "Immortal Flames",
"rank": "Second Flame Lieutenant"
},
"nameday": "16th Sun of the 4th Astral Moon",
"citystate": "Ul'dah",
"guardian": "Byregot, the Builder",
"blurb": ""
}
Note that I am not affiliated with this player.
Searching
Signature: ns.Character.Search(object) => Promise<Array, Error>
Find a character on the Lodestone. Provide an object with one or more of the following keys:
| Key | Type | Description |
| :----------: | :-------------: | :--------------------------------------- |
| name | String | Character name |
| world | String | World name (alias server
) |
| job | String | Job name or abbreviation (alias class
) |
| race | String | Race or tribe name (such as Roegadyn
or Sea Wolf
) |
| grandcompany | String or Array | Grand Company name (or none
) |
| language | String or Array | Language(s) - ja
, en
, de
, fr
|
Resolves with an array of truncated character documents, or an Error. Each document includes the character's id
, name
, server
and freecompany
object (or null
).
Free Companies
Signature: ns.Company(string || object) => Promise<Object, Error>
As with Nodestone.Character
, allows you to retrieve a Free Company from the Lodestone. As well as passing the ID directly, or an object with the appropriate ID, you can also use an object with the key freecompany
(such as a character retrieved by ns.Character()
) and that object will be used instead.
Resolves to a JSON document as shown below, or rejects with an Error.
{
"id": "9234771773411585379",
"name": "Company Of Heroes",
"server": "Goblin",
"grandcompany": {
"name": "Immortal Flames",
"standing": "Allied"
},
"tag": "Hero",
"formed": "25 May 2014",
"members": 386,
"rank": 8,
"ranking": {
"weekly": 5,
"monthly": 13
},
"slogan": "",
"focus": [
"Role-playing",
"Leveling",
"Casual",
"Hardcore",
"Dungeons",
"Trials",
"Raids",
"PvP"
],
"seeking": [
"Tank",
"Healer",
"DPS",
"Crafter",
"Gatherer"
],
"active": "always",
"recruiting": true,
"estate": {
"title": "Hall of Heroes",
"address": {
"plot": 35,
"ward": 8,
"region": "The Goblet"
},
"size": "Large",
"greeting": ""
}
}
Note that I am not affiliated with this Free Company.
Company Members
Signature: ns.Company.Members(string || object) => Promise<Array, Error>
Allows you to retrieve all members of a given Free Company. Note that this retrieves only one page at a time (so as not to be rude) and thus can take quite a while to resolve for large companies.
Resolves to an Array of truncated character documents, or an Error. Each document includes the character's id
, name
, server
and rank
(being their rank name in the Free Company).
Searching
Signature: ns.Company.Search(object) => Promise<Array, Error>
Find a Free Company on the Lodestone. Provide an object with one or more of the following keys:
| Key | Type | Description |
| :----------: | :-------------: | :--------------------------------------- |
| name | String | Free Company name |
| world | String | World name (alias server
) |
| focus | String or Array | List of activities (roleplaying
, leveling
, etc, alias activities
) |
| roles | String or Array | List of sought roles (Tank
, Healer
, DPS
, Crafter
, Gatherer
) |
| active | String | Active time (always
, weekdays
, weekends
) |
| recruiting | String | If the company is recruiting (open
or closed
, alias recruitment
) |
| housing | String | Company housing status (estate
, plot
, none
) |
| grandcompany | String | As with player grandcompany
|
Resolves with an array of truncated character documents, or an Error. Each document includes the company's id
, name
, server
, members
, active
status and recruiting
status.
Timers
Signature: new Timer(time, date)
A home-grown Timer class, for tracking resets. The things you should need to know to use these:
Moment Timer.when
The target time.
Moment.Duration Timer.until
The length of time that remains.
String Timer.toString()
The remaining time as a string (such as "3 days, 11 hours" or "2 hours, 15 minutes")
For the date
argument, you can pass either an actual date or only a day of the week. In the case of an actual date, the timer will not reset itself to the next occurrence of that date, and will instead simply start returning a blank string. Otherwise, the timer will cycle, always showing the next occurrence. Note that directly accessing timer fields rather than through the getters shown above will not exhibit proper behaviour - please use appropriately.
Three inbuilt timers are provided, on the ns.Resets
object - one for the Daily reset, one for the Weekly reset and one for the Red Scrips reset.