Skip to content

Commit ee30be3

Browse files
author
Kimon Kar
authored
Update README.md
1 parent 9cd0a57 commit ee30be3

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

README.md

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,29 @@ If you get really stuck and need some help, or run into any problems/concerns, e
2626

2727
### Examples:
2828

29-
Find an item ID, and then get the lowest market board price in a specific server:
29+
Find an item's ID:
3030
```js
3131
const getItemPrice = async () => {
3232
//find item
3333
let res = await xiv.search('Stuffed Khloe')
3434

35-
//use item ID for market query
36-
res = await xiv.market.get(res.Results[0].ID, {servers: 'Excalibur'})
37-
38-
//return lowest price
39-
return res.Prices[0].PricePerUnit
35+
//return item ID
36+
return res.Results[0].ID
4037
}
4138
```
4239

43-
Get the most recent lodestone news post:
40+
Search for an FC and get an list of members:
4441
```javascript
45-
const getLatestNews = async () => {
46-
//get the lodestone state
47-
let ls = await xiv.lodestone()
48-
49-
//get most recent entry
50-
let entry = ls.News[0]
42+
const getMembers = async () => {
43+
//find the FC with its name and server
44+
let res = await xiv.freecompany.search('My Fun FC', {server: 'Excalibur'})
5145

52-
//get the time since the entry's creation
53-
let timeNow = new Date()
54-
let diff = new Date(timeNow - entry.Time) //xivapi-js converts the timestamp into a Date object,
55-
//so you can just do this!
46+
//get the FC ID
47+
let id = res.Results[0].ID
5648

57-
//return your parsed entry
58-
console.log(`${entry.Title} (published ${diff.getUTCMinutes()} minutes ago)`)
49+
//get and return fc members
50+
let fc = await xiv.freecompany.get('9231253336202687179', {data: FCM})
51+
return fc.FreeCompanyMembers
5952
}
6053
```
6154

@@ -65,11 +58,11 @@ const verifyCharacter = async () => {
6558
//find the character with their name and server
6659
let res = await xiv.character.search('Kai Megumi', {server: 'excalibur'}) //case insensitive server names, btw ;)
6760

68-
//get the character's ID
69-
let id = res.Results[0].ID
61+
//get the character
62+
let char = res.Results[0]
7063

7164
//return whether or not the character's lodestone bio matches our token
72-
return await xiv.character.verification(id, 'token string')
65+
return char.Bio === 'example_token'
7366
}
7467
```
7568

0 commit comments

Comments
 (0)