Skip to content

Commit

Permalink
#1 Finalised Special Shop entries, extending the currency object wher…
Browse files Browse the repository at this point in the history
…e necessary.
  • Loading branch information
JamesDonnelly committed Jun 2, 2019
1 parent a44e57e commit 36ea9c1
Show file tree
Hide file tree
Showing 56 changed files with 28 additions and 30 deletions.
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/crafting.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/methods/gathering.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"minion":[{"contentId":38,"icon":60438,"iconPath":"/i/060000/060438.png","job":{"level":50,"name":{"de":"Minenarbeiter (Abbauen)","en":"Mining","fr":"Extraction de minerai","ja":"採掘"}},"location":{"de":"Östliches Thanalan","en":"Eastern Thanalan","fr":"Thanalan oriental","ja":"東ザナラーン"}},{"contentId":48,"icon":60432,"iconPath":"/i/060000/060432.png","job":{"level":50,"name":{"de":"Gärtner (Abernten)","en":"Harvesting","fr":"Fauche","ja":"草刈"}},"location":{"de":"Ostwald","en":"East Shroud","fr":"Forêt de l'est","ja":"黒衣森:東部森林"}},{"contentId":24,"icon":60929,"iconPath":"/i/060000/060929.png","job":{"level":20,"name":{"de":"Angeln","en":"Fishing","fr":"Pêche","ja":"釣り"}},"location":{"de":"Unteres La Noscea","en":"Lower La Noscea","fr":"Basse-Noscea","ja":"低地ラノシア"}},{"contentId":30,"icon":60929,"iconPath":"/i/060000/060929.png","job":{"level":40,"name":{"de":"Angeln","en":"Fishing","fr":"Pêche","ja":"釣り"}},"location":{"de":"Östliches Thanalan","en":"Eastern Thanalan","fr":"Thanalan oriental","ja":"東ザナラーン"}},{"contentId":188,"icon":60929,"iconPath":"/i/060000/060929.png","job":{"level":53,"name":{"de":"Angeln","en":"Fishing","fr":"Pêche","ja":"釣り"}},"location":{"de":"Westliches Hochland von Coerthas","en":"Coerthas Western Highlands","fr":"Hautes terres du Coerthas occidental","ja":"クルザス西部高地"}},{"contentId":237,"icon":60929,"iconPath":"/i/060000/060929.png","job":{"level":50,"name":{"de":"Angeln","en":"Fishing","fr":"Pêche","ja":"釣り"}},"location":{"de":"Östliches La Noscea","en":"Eastern La Noscea","fr":"Noscea orientale","ja":"東ラノシア"}},{"contentId":244,"icon":60929,"iconPath":"/i/060000/060929.png","job":{"level":70,"name":{"de":"Speerfischen","en":"Spear fishing","fr":"Pêche au harpon","ja":"銛"},"stars":0},"location":{"de":"Rubinsee","en":"The Ruby Sea","fr":"Mer de Rubis","ja":"紅玉海"}}]}
{}
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 docs/icons/currency.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"65002":[36,0,36,36],"65004":[144,108,36,36],"65005":[0,36,36,36],"65006":[36,36,36,36],"65012":[72,0,36,36],"65013":[72,36,36,36],"65014":[0,72,36,36],"65022":[36,72,36,36],"65023":[72,72,36,36],"65024":[108,0,36,36],"65025":[108,36,36,36],"65028":[108,72,36,36],"65029":[0,108,36,36],"65030":[36,108,36,36],"65031":[72,108,36,36],"65032":[108,108,36,36],"65033":[144,0,36,36],"65034":[144,36,36,36],"65038":[144,72,36,36],"65041":[0,0,36,36],"65043":[0,144,36,36],"65044":[36,144,36,36],"65045":[72,144,36,36],"65046":[108,144,36,36],"65049":[144,144,36,36],"65050":[180,0,36,36],"65051":[180,36,36,36],"65052":[180,72,36,36],"65053":[180,108,36,36],"65054":[180,144,36,36],"65055":[0,180,36,36],"65056":[36,180,36,36],"65057":[72,180,36,36],"65058":[108,180,36,36],"65059":[144,180,36,36],"65061":[180,180,36,36],"65062":[216,0,36,36],"65064":[216,36,36,36],"65065":[216,72,36,36]}
{"20015":[40,0],"20624":[240,80],"20625":[160,120],"20956":[0,40],"21002":[40,40],"21017":[80,0],"21018":[80,40],"21019":[0,80],"21203":[40,80],"21254":[80,80],"21256":[120,0],"21270":[120,40],"21308":[120,80],"21901":[0,120],"22204":[40,120],"22217":[80,120],"22218":[120,120],"24063":[160,0],"24067":[160,40],"25918":[160,80],"25950":[0,0],"25951":[0,160],"25995":[40,160],"26107":[80,160],"26108":[120,160],"26169":[160,160],"26172":[200,0],"26177":[200,40],"26274":[200,80],"26275":[200,120],"26434":[200,160],"26444":[0,200],"26510":[40,200],"26511":[80,200],"26521":[120,200],"26529":[160,200],"26533":[200,200],"26541":[240,0],"26545":[240,40],"65002":[180,312,36,36],"65004":[240,156,36,36],"65005":[240,192,36,36],"65006":[0,240,36,36],"65012":[36,240,36,36],"65013":[72,240,36,36],"65014":[108,240,36,36],"65022":[144,240,36,36],"65023":[180,240,36,36],"65024":[216,240,36,36],"65025":[280,0,36,36],"65028":[280,36,36,36],"65029":[280,72,36,36],"65030":[280,108,36,36],"65031":[280,144,36,36],"65032":[280,180,36,36],"65033":[280,216,36,36],"65034":[0,276,36,36],"65038":[36,276,36,36],"65041":[72,276,36,36],"65043":[108,276,36,36],"65044":[144,276,36,36],"65045":[180,276,36,36],"65046":[216,276,36,36],"65049":[252,276,36,36],"65050":[316,0,36,36],"65051":[316,36,36,36],"65052":[316,72,36,36],"65053":[316,108,36,36],"65054":[316,144,36,36],"65055":[316,180,36,36],"65056":[316,216,36,36],"65057":[316,252,36,36],"65058":[0,312,36,36],"65059":[36,312,36,36],"65061":[72,312,36,36],"65062":[108,312,36,36],"65064":[144,312,36,36],"65065":[240,120,36,36]}
Binary file modified docs/icons/currency.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/20015.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/20624.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/20625.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/20956.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21017.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21018.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21019.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21203.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21254.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21270.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21308.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/21901.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/22204.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/22217.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/22218.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/24063.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/24067.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/25918.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/25950.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/25951.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/25995.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/26107.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons-raw/currency/26108.png
Binary file added icons-raw/currency/26169.png
Binary file added icons-raw/currency/26172.png
Binary file added icons-raw/currency/26177.png
Binary file added icons-raw/currency/26274.png
Binary file added icons-raw/currency/26275.png
Binary file added icons-raw/currency/26434.png
Binary file added icons-raw/currency/26444.png
Binary file added icons-raw/currency/26510.png
Binary file added icons-raw/currency/26511.png
Binary file added icons-raw/currency/26521.png
Binary file added icons-raw/currency/26529.png
Binary file added icons-raw/currency/26533.png
Binary file added icons-raw/currency/26541.png
Binary file added icons-raw/currency/26545.png
2 changes: 1 addition & 1 deletion src/APICrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = class APICrawler {
: ResultsPerPage * pageIn
);

if (pageIn === 1) {
if (PageNext === 2) {
progressBar = new Progress.Bar({}, Progress.Presets.shades_grey);
progressBar.start(ResultsTotal, processedRecordsCount);
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/parsers/currencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = (data, isExternalParse) => {
fs.writeFileSync(
'../data/currencies.json',
JSON.stringify(parsed),
'utf8',
() => console.info(`${config.log} data parsed.`)
'utf8'
);
console.info(`${config.log} data parsed.`);
};
4 changes: 2 additions & 2 deletions src/parsers/gathering.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ module.exports = (
fs.writeFileSync(
'../data/methods/gathering.json',
JSON.stringify(parsed),
'utf8',
() => console.info(`Gathering data parsed.`)
'utf8'
);
console.info(`Gathering data parsed.`);
};
2 changes: 0 additions & 2 deletions src/parsers/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ async function fetchIconsFromPaths(paths = [], folderRef = '') {
for (const [index, path] of paths.entries()) {
await new Promise(resolve => {
const apiPath = `https://xivapi.com${path}`;

console.info(path);

const savePath = `../icons-raw/${folderRef}/${(
path.replace(/^.*\/(\d+)\.png$/, (_, group) => {
Expand Down
4 changes: 2 additions & 2 deletions src/parsers/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = (data) => {
fs.writeFileSync(
'../data/items.json',
JSON.stringify(parsed),
'utf8',
() => console.info(`${config.log} data parsed.`)
'utf8'
);
console.info(`${config.log} data parsed.`);
};
4 changes: 2 additions & 2 deletions src/parsers/quests.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = (data) => {
fs.writeFileSync(
'../data/methods/quests.json',
JSON.stringify(parsed),
'utf8',
() => console.info(`${config.log} data parsed.`)
'utf8'
);
console.info(`${config.log} data parsed.`);
};
4 changes: 2 additions & 2 deletions src/parsers/recipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = (data) => {
fs.writeFileSync(
'../data/methods/crafting.json',
JSON.stringify(parsed),
'utf8',
() => console.info(`${config.log} data parsed.`)
'utf8'
);
console.info(`${config.log} data parsed.`);
};
16 changes: 8 additions & 8 deletions src/parsers/shops.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = (
gcScripShopItems
) => {
const config = require('../config/data').shops;
const initialCurrenciesLength = currencies.length;
let currenciesAddedCount = 0;
const parsed = {};

const allItems = Object.values(items).reduce((arr, itemGroup) => ([
Expand Down Expand Up @@ -96,6 +96,7 @@ module.exports = (
// If the currency is missing it means the currency object needs extending.
if (!currency) {
currency = addNewCustomCurrencyItem(specialShop[`ItemCost${specialShopItemIndex}`]);
currenciesAddedCount++;
}

return [
Expand Down Expand Up @@ -197,22 +198,21 @@ module.exports = (
});

// If there are new currencies, overwrite the currencies JSON file.
const newCurrenciesCount = currencies.length - initialCurrenciesLength;
if (newCurrenciesCount > 0) {
if (currenciesAddedCount > 0) {
fs.writeFileSync(
'../data/currencies.json',
JSON.stringify(currencies),
'utf8',
() => console.info(`Updated Currencies data to include ${newCurrenciesCount} new items.`)
'utf8'
);
console.info(`Updated Currencies data to include ${currenciesAddedCount} new items.`)
}

fs.writeFileSync(
'../data/methods/shops.json',
JSON.stringify(parsed),
'utf8',
() => console.info(`Shop data parsed.`)
'utf8'
);
console.info(`Shop data parsed.`)
};

/**
Expand All @@ -232,7 +232,7 @@ function addNewCustomCurrencyItem(item) {

// Send the raw currency data through the parser and extract the parsed data from the output.
const newCurrency = (currencyParser([rawCurrency], true))[0];
console.info(`Extended Currencies object to include ${newCurrency.Name_en}.`);
console.info(`Extended Currencies object to include '${newCurrency.name.en}'.`);

// Extend the currencies array.
currencies.push(newCurrency);
Expand Down
4 changes: 2 additions & 2 deletions src/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class API {
const gcScripShopItems = await this.crawl(config.shops.gcScripShopItem);
require ('./parsers/shops')(
eNPCResidents,
gcScripShopItems
[]
);

console.info('Finished parsing of misc required data.');
Expand All @@ -108,7 +108,7 @@ class API {
return;
}

const list = await this.crawl(config.list);
// const list = await this.crawl(config.list);
}
}

Expand Down

0 comments on commit 36ea9c1

Please sign in to comment.