Skip to content

Commit

Permalink
#1 Implemented API call caching and package script support.
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDonnelly committed Jun 4, 2019
1 parent ecfc498 commit 8356298
Show file tree
Hide file tree
Showing 32 changed files with 283 additions and 101 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.DS_Store
xivapi-key.txt
xivapi-key.txt
data/cached/*.json
18 changes: 14 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API v3

Work in progress. Nothing to see here... yet.
Work in progress. Not much to see here yet!

## Installation

Expand All @@ -17,9 +17,11 @@ npm install
Running this will update _everything_ and will likely take up to an hour if not longer to complete.

```
node src/update.js
npm run update
```

This will automatically increase the memory to 4096. If this isn't required on your machine, simply remove `--max-old-space-size=4096` from the update script within package.json.

### Individual parts

To update parts individually, you can append a keyword to the end of the command to update everything to just update specific chunks:
Expand All @@ -29,13 +31,21 @@ To update parts individually, you can append a keyword to the end of the command
This updates all data required to ulitimately form the obtain method information and sprite sheets.

```
node src/update.js data
npm run update data
```

#### Icons

This will create sprite sheets from the fetched data.

```
node src/update.js icons
npm run update icons
```

### Cached Data

To avoid bombarding the API with repeated calls every time we want to fetch data, any API call which is paginated will be saved in `data/cached`. This can be cleared by running:

```
npm run update cache
```
1 change: 1 addition & 0 deletions data/cached/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This folder caches data from the API so that multiple calls do not result in DoS-like attacks. This folder can either be cleared out manually (by removing all the files but leaving the folder empty), or by running `node update.js cache`.
2 changes: 1 addition & 1 deletion data/content/achievements.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/content/barding.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/content/mounts.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/currencies.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/items.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/methods/quests.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/methods/shops.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/npcs.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/en/emotes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"i":64001,"id":1,"m":[],"n":"Surprised","p":0},{"i":64002,"id":2,"m":[],"n":"Angry","p":0},{"i":64003,"id":3,"m":[],"n":"Furious","p":0},{"i":64004,"id":4,"m":[],"n":"Blush","p":0},{"i":64005,"id":5,"m":[],"n":"Bow","p":0},{"i":64006,"id":6,"m":[],"n":"Cheer","p":0},{"i":64007,"id":7,"m":[],"n":"Clap","p":0},{"i":64008,"id":8,"m":[],"n":"Beckon","p":0},{"i":64009,"id":9,"m":[],"n":"Comfort","p":0},{"i":64010,"id":10,"m":[],"n":"Cry","p":0},{"i":64011,"id":11,"m":[],"n":"Dance","p":0},{"i":64012,"id":12,"m":[],"n":"Doubt","p":0},{"i":64013,"id":13,"m":[],"n":"Doze","p":0},{"i":64014,"id":14,"m":[],"n":"Fume","p":0},{"i":64015,"id":15,"m":[],"n":"Goodbye","p":0},{"i":64016,"id":16,"m":[],"n":"Wave","p":0},{"i":64017,"id":17,"m":[],"n":"Huh","p":0},{"i":64018,"id":18,"m":[],"n":"Joy","p":0},{"i":64019,"id":19,"m":[],"n":"Kneel","p":0},{"i":64020,"id":20,"m":[],"n":"Chuckle","p":0},{"i":64021,"id":21,"m":[],"n":"Laugh","p":0},{"i":64022,"id":22,"m":[],"n":"Lookout","p":0},{"i":64023,"id":23,"m":[],"n":"Me","p":0},{"i":64024,"id":24,"m":[],"n":"No","p":0},{"i":64025,"id":25,"m":[],"n":"Deny","p":0},{"i":64026,"id":26,"m":[],"n":"Panic","p":0},{"i":64027,"id":27,"m":[],"n":"Point","p":0},{"i":64028,"id":28,"m":[],"n":"Poke","p":0},{"i":64029,"id":29,"m":[],"n":"Congratulate","p":0},{"i":64030,"id":30,"m":[],"n":"Psych","p":0},{"i":64031,"id":31,"m":[],"n":"Salute","p":0},{"i":64032,"id":32,"m":[],"n":"Shocked","p":0},{"i":64033,"id":33,"m":[],"n":"Shrug","p":0},{"i":64034,"id":34,"m":[],"n":"Rally","p":0},{"i":64035,"id":35,"m":[],"n":"Soothe","p":0},{"i":64036,"id":36,"m":[],"n":"Stagger","p":0},{"i":64037,"id":37,"m":[],"n":"Stretch","p":0},{"i":64038,"id":38,"m":[],"n":"Sulk","p":0},{"i":64039,"id":39,"m":[],"n":"Think","p":0},{"i":64040,"id":40,"m":[],"n":"Upset","p":0},{"i":64041,"id":41,"m":[],"n":"Welcome","p":0},{"i":64042,"id":42,"m":[],"n":"Yes","p":0},{"i":64043,"id":43,"m":[],"n":"Thumbs Up","p":0},{"i":64044,"id":44,"m":[],"n":"Examine Self","p":0},{"i":64045,"id":45,"m":[],"n":"Pose","p":0},{"i":64049,"id":46,"m":[],"n":"Blow Kiss","p":0},{"i":64051,"id":47,"m":[],"n":"Grovel","p":0},{"i":64052,"id":48,"m":[],"n":"Happy","p":0},{"i":64053,"id":49,"m":[],"n":"Disappointed","p":0},{"i":64056,"id":50,"m":[],"n":"Sit","p":0},{"i":64054,"id":52,"m":[],"n":"Sit on Ground","p":0},{"i":64063,"id":54,"m":[],"n":"Air Quotes","p":0},{"i":64046,"id":55,"m":[],"n":"Storm Salute","p":0},{"i":64047,"id":56,"m":[],"n":"Serpent Salute","p":0},{"i":64048,"id":57,"m":[],"n":"Flame Salute","p":0},{"i":64064,"id":58,"m":[],"n":"Pray","p":0},{"i":64066,"id":59,"m":[],"n":"Imperial Salute","p":0},{"i":64065,"id":60,"m":[],"n":"Visor","p":0},{"i":64352,"id":62,"m":[],"n":"Megaflare","p":44},{"i":64353,"id":63,"m":[],"n":"Crimson Lotus","p":45},{"i":64354,"id":64,"m":[["specialShopShort",65061,[5,"Ananta Dreamstaff","Madhura","The Fringes",20.979152,26.254158]]],"n":"Charmed","p":43},{"i":64355,"id":65,"m":[["eventQuestShort",80109,[15,"A Colorful Affair","Seasonal Events"]]],"n":"Cheer On","p":43},{"i":64356,"id":66,"m":[["eventQuestShort",80109,[15,"A Colorful Affair","Seasonal Events"]]],"n":"Cheer Wave","p":43},{"i":64357,"id":67,"m":[["eventQuestShort",80109,[15,"A Colorful Affair","Seasonal Events"]]],"n":"Cheer Jump","p":43},{"i":64101,"id":68,"m":[],"n":"Straight Face","p":0},{"i":64102,"id":69,"m":[],"n":"Smile","p":0},{"i":64103,"id":70,"m":[],"n":"Grin","p":0},{"i":64104,"id":71,"m":[],"n":"Smirk","p":0},{"i":64105,"id":72,"m":[],"n":"Taunt","p":0},{"i":64106,"id":73,"m":[],"n":"Shut Eyes","p":0},{"i":64107,"id":74,"m":[],"n":"Sad","p":0},{"i":64108,"id":75,"m":[],"n":"Scared","p":0},{"i":64109,"id":76,"m":[],"n":"Amazed","p":0},{"i":64110,"id":77,"m":[],"n":"Ouch","p":0},{"i":64111,"id":78,"m":[],"n":"Annoyed","p":0},{"i":64112,"id":79,"m":[],"n":"Alert","p":0},{"i":64113,"id":80,"m":[],"n":"Worried","p":0},{"i":64125,"id":81,"m":[["specialShopShort",65025,[20000,"MGP","Gold Saucer attendant","The Gold Saucer",5.144724,6.682504]]],"n":"Big Grin","p":43},{"i":64126,"id":82,"m":[],"n":"Reflect","p":43},{"i":64127,"id":83,"m":[],"n":"Furrow","p":43},{"i":64128,"id":84,"m":[],"n":"Scoff","p":43},{"i":64050,"id":85,"m":[],"n":"Throw","p":4},{"i":64068,"id":90,"m":[],"n":"Change Pose","p":4},{"i":64069,"id":101,"m":[],"n":"Step Dance","p":8},{"i":64070,"id":102,"m":[],"n":"Harvest Dance","p":8},{"i":64071,"id":103,"m":[],"n":"Ball Dance","p":8},{"i":64072,"id":104,"m":[],"n":"Manderville Dance","p":8},{"i":64067,"id":105,"m":[],"n":"Pet","p":12},{"i":64073,"id":106,"m":[],"n":"Hand Over","p":12},{"i":64074,"id":109,"m":[],"n":"Bomb Dance","p":11},{"i":64075,"id":110,"m":[],"n":"Huzzah","p":12},{"i":64076,"id":111,"m":[],"n":"Slap","p":13},{"i":64077,"id":112,"m":[],"n":"Hug","p":13},{"i":64078,"id":113,"m":[],"n":"Embrace","p":15},{"i":64079,"id":114,"m":[],"n":"Most Gentlemanly","p":16},{"i":64080,"id":115,"m":[],"n":"Fist Bump","p":19},{"i":64082,"id":118,"m":[["specialShopShort",65025,[80000,"MGP","Gold Saucer attendant","The Gold Saucer",5.144724,6.682504]]],"n":"Thavnairian Dance","p":23},{"i":64083,"id":119,"m":[["specialShopShort",65025,[80000,"MGP","Gold Saucer attendant","The Gold Saucer",5.144724,6.682504]]],"n":"Gold Dance","p":23},{"i":64084,"id":120,"m":[],"n":"Sundrop Dance","p":23},{"i":64085,"id":121,"m":[],"n":"Battle Stance","p":25},{"i":64086,"id":122,"m":[],"n":"Victory","p":25},{"i":64087,"id":123,"m":[],"n":"Backflip","p":32},{"i":64088,"id":124,"m":[],"n":"Eastern Greeting","p":30},{"i":64089,"id":125,"m":[],"n":"Eureka","p":26},{"i":64090,"id":126,"m":[],"n":"Moogle Dance","p":27},{"i":64091,"id":127,"m":[],"n":"Haurchefant","p":27},{"i":64092,"id":128,"m":[],"n":"Eastern Stretch","p":36},{"i":64093,"id":129,"m":[],"n":"Eastern Dance","p":36},{"i":64094,"id":130,"m":[],"n":"Red Ranger Pose A","p":28},{"i":64095,"id":131,"m":[],"n":"Black Ranger Pose A","p":28},{"i":64096,"id":132,"m":[],"n":"Yellow Ranger Pose A","p":28},{"i":64118,"id":133,"m":[],"n":"Wink (Right)","p":27},{"i":64097,"id":134,"m":[],"n":"Red Ranger Pose B","p":28},{"i":64098,"id":135,"m":[],"n":"Black Ranger Pose B","p":28},{"i":64099,"id":136,"m":[],"n":"Yellow Ranger Pose B","p":28},{"i":64326,"id":137,"m":[],"n":"Facepalm","p":30},{"i":64327,"id":138,"m":[],"n":"Zantetsuken","p":30},{"i":64328,"id":139,"m":[],"n":"Flex","p":30},{"i":64329,"id":140,"m":[],"n":"Pay Respects","p":30},{"i":64119,"id":141,"m":[],"n":"Sneer","p":30},{"i":64330,"id":142,"m":[],"n":"Pretty Please","p":40},{"i":64331,"id":143,"m":[],"n":"Play Dead","p":32},{"i":64332,"id":144,"m":[],"n":"Diamond Dust","p":38},{"i":64333,"id":145,"m":[],"n":"Moonlift Dance","p":32},{"i":64334,"id":146,"m":[],"n":"Dote","p":32},{"i":64335,"id":148,"m":[],"n":"Spectacles","p":32},{"i":64336,"id":149,"m":[],"n":"Songbird","p":32},{"i":64337,"id":150,"m":[],"n":"Water Float","p":36},{"i":64338,"id":151,"m":[],"n":"Water Flip","p":36},{"i":64120,"id":152,"m":[],"n":"Pucker Up","p":36},{"i":64339,"id":153,"m":[],"n":"Power Up","p":43},{"i":64340,"id":154,"m":[],"n":"Eastern Bow","p":36},{"i":64341,"id":155,"m":[],"n":"Squats","p":40},{"i":64342,"id":156,"m":[],"n":"Push-ups","p":40},{"i":64343,"id":157,"m":[],"n":"Sit-ups","p":40},{"i":64344,"id":158,"m":[],"n":"Breath Control","p":40},{"i":64345,"id":159,"m":[],"n":"Converse","p":40},{"i":64121,"id":160,"m":[],"n":"Concentrate","p":40},{"i":64122,"id":161,"m":[],"n":"Confused","p":40},{"i":64123,"id":162,"m":[],"n":"Simper","p":40},{"i":64124,"id":163,"m":[],"n":"Beam","p":40},{"i":64346,"id":164,"m":[],"n":"Attention","p":40},{"i":64347,"id":165,"m":[],"n":"At Ease","p":40},{"i":64348,"id":166,"m":[],"n":"Box","p":40},{"i":64349,"id":167,"m":[["specialShopShort",65058,[3,"Kojin Sango","Shikitahe","The Ruby Sea",29.362711,16.888201]]],"n":"Ritual Prayer","p":40},{"i":64358,"id":169,"m":[["specialShopShort",26444,[6,"Mythic Clan Mark Log","Eschina","Rhalgr's Reach",13.901247,11.823379]]],"n":"Tremble","p":43},{"i":64359,"id":170,"m":[["specialShopShort",26444,[6,"Mythic Clan Mark Log","Eschina","Rhalgr's Reach",13.901247,11.823379]]],"n":"Winded","p":43},{"i":64360,"id":171,"m":[["gilShopShort",65002,[5000,"Gil","Kasumi","The Gold Saucer",7.292839,7.377162]]],"n":"Aback","p":43},{"i":64361,"id":172,"m":[],"n":"Greeting","p":43},{"i":64362,"id":173,"m":[],"n":"Box Step","p":49},{"i":64363,"id":174,"m":[],"n":"Side Step","p":49},{"i":64364,"id":175,"m":[],"n":"Ultima","p":51},{"i":64365,"id":176,"m":[["specialShopShort",65064,[8,"Namazu Koban","Gyosho","The Azim Steppe",5.83842,23.511583]]],"n":"Yol Dance","p":45},{"i":64366,"id":178,"m":[],"n":"Splash","p":45},{"i":64367,"id":180,"m":[],"n":"Sweat","p":47},{"i":64368,"id":181,"m":[],"n":"Shiver","p":48},{"i":64369,"id":182,"m":[["specialShopShort",65014,[15000,"Wolf Mark","storm sergeant","Wolves' Den Pier",4.48544,6.113689]]],"n":"Elucidate","p":45},{"i":64129,"id":183,"m":[],"n":"Ponder","p":45},{"i":64130,"id":184,"m":[],"n":"Wink (Left)","p":45},{"i":64370,"id":185,"m":[],"n":"Get Fantasy","p":51},{"i":64371,"id":186,"m":[],"n":"Popoto Step","p":51},{"i":64372,"id":187,"m":[],"n":"Hum","p":49},{"i":64373,"id":188,"m":[],"n":"Confirm","p":49},{"i":64374,"id":189,"m":[],"n":"Scheme","p":51},{"i":64131,"id":190,"m":[],"n":"Endure","p":49},{"i":64375,"id":191,"m":[],"n":"Tomestone","p":49},{"i":64378,"id":194,"m":[],"n":"Gratuity","p":52},{"i":64379,"id":195,"m":[],"n":"Fist Pump","p":52},{"i":64380,"id":196,"m":[["specialShopShort",65014,[15000,"Wolf Mark","storm sergeant","Wolves' Den Pier",4.48544,6.113689]]],"n":"Reprimand","p":51},{"i":64381,"id":197,"m":[],"n":"Senor Sabotender","p":51},{"i":64382,"id":198,"m":[],"n":"Manderville Mambo","p":52}]
Loading

0 comments on commit 8356298

Please sign in to comment.