All files for repo

This commit is contained in:
Ben Carter
2023-09-12 16:24:06 -04:00
commit fd8f78d17e
18 changed files with 6462 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules

9
blacksmithing_recipe.ts Normal file
View File

@@ -0,0 +1,9 @@
import { merge } from "lodash";
import { minePricing } from "./data-miners/minePriceNexus";
import recipes from "./items/blacksmith-recipes.json";
(async () => {
await minePricing(recipes, './sql/acore_world/mp_mine_smithing_nexus.sql');
})();

7
cloth.ts Normal file
View File

@@ -0,0 +1,7 @@
import { minePricing } from "./data-miners/minePriceNexus";
import cloth from "./items/cloth.json";
(async () => {
await minePricing(cloth, './sql/acore_world/mp_cloth_nexus.sql');
})();

View File

@@ -0,0 +1,131 @@
import { launch } from 'puppeteer';
import * as fs from 'fs';
import sleep from 'sleep-promise';
import { lowerCase, toLower } from 'lodash';
const BASE_URL = 'https://ne' + 'xus' + 'hub.co/' + 'wow-classic/items/';
const urls: Map<number, any> = new Map();
// Used to hold the sql statements that are then created for updates to ACore database.
const sqlInsert: string[] = [];
const sqlDelete: number[] = [];
// Used to parse currency string XXg YYx ZZc
function convertToCopper(text: string): number {
// const parts = text.trim();
const regex = /(\d*g)?\s*(\d*s)?\s*(\d*c)?/;
const match = text.trim().match(regex);
let gold, silver, copper, total;
if (match) {
const [, gValue, sValue, cValue] = match;
gold = (gValue) ? gValue.slice(0,-1) : 0;
silver = (sValue) ? sValue.slice(0,-1) : 0;
copper = (cValue) ? cValue.slice(0,-1) : 0;
total = (+gold * 10000) + (+silver * 100) + (+copper);
} else {
console.log('failed to match: ', text);
return 0;
}
console.log('ValueText:', text, 'Gold:', gold+ 'g Silver:', silver+ 's Copper:',copper+'c ConvertedValue:', total);
return total;
}
/**
* Scrapes a site that seems to have the best data for legacy WotLK data.
* This looks up nexus data.
* == This has to be run from a system with access to Chromium browser as that is what Puppeteer relies on!
*
* @param itemList list of items to scan for. object must have entry and name;
* @param file - where to create the market sql statements;
* @returns Promise<string>
*/
export async function minePricing(items: any, file: string): Promise<void> {
const browser = await launch({ headless: "new" });
// build a list of deep links into the page we need to scrape for median price.
for (const item of items) {
let itemName = item.name.replace(/\s+/g, '-')
.replace(/\'/g, '');
itemName = itemName.replace(/:/g,'');
itemName = toLower(itemName);
urls.set(item.entry, {
url: `${BASE_URL}${itemName}`,
itemName
});
}
// create a new file;
try {
fs.writeFileSync(file, '');
} catch (err: any) {
console.error(err.message);
}
const page = await browser.newPage();
for (const [entry, url] of urls) {
let error = false;
await page.goto(url.url, { timeout: 8000, waitUntil: 'domcontentloaded' })
.catch( () => {
console.log(`failed to load ${url.url} skipp...`);
error = true;
});
// do a sleep to keep from killing the server or getting blocked by DDoS detection :)
if (error) {
continue;
}
// await sleep(100);
await page.waitForSelector('.data-price', { timeout: 250})
.catch(() => {
error = true;
console.log('Could not find the element with class: .data-price, likely a bad item: ', url.url);
});
// If we failed to find a selector that has the data we need to continue on to the next item.
if (error) {
continue;
}
const dataPrice = await page.$$('.data-price');
let usCost,total;
if (dataPrice) {
const row = dataPrice[2];
if(!row) {
console.log('Missing US Price...');
continue;
}
usCost = await row.evaluate((element) => element.textContent);
if(usCost) {
usCost = usCost.trim();
total = convertToCopper(usCost);
}
} else {
console.error('Failed to find .data-price selector on item');
}
const deleteStmt = `DELETE FROM market_pricing WHERE entry = ${entry};`;
let sql = 'INSERT INTO market_pricing (entry,cost,human_cost) VALUES ';
sql += `('${entry}', '${total}', '${usCost}'); -- ${url.itemName}`;
try {
fs.appendFileSync(file, `${deleteStmt}\n${sql}\n`);
} catch (err: any) {
console.error(err.message);
}
}
browser.close();
}

View File

@@ -0,0 +1,122 @@
import { launch } from 'puppeteer';
import * as fs from 'fs';
const BASE_URL = 'https://under' + 'mine' + '.exchange/#us-' + 'area-52/';
const urls: Map<number, string> = new Map();
// Used to hold the sql statements that are then created for updates to ACore database.
const sqlInsert: string[] = [];
const sqlDelete: number[] = [];
/**
* Scrapes a site that seems to have the best data for legacy WotLK data.
* The data is not available from the source unfortunately any other way that I could find. :(
* == This has to be run from a system with access to Chromium browser as that is what Puppeteer relies on!
*
* @param itemList list of items to scan for. object must have entry and name;
* @param file - where to create the market sql statements;
* @returns Promise<string>
*/
export async function minePricing(items: any, file: string): Promise<void> {
const browser = await launch({ headless: "new" });
// build a list of deep links into the page we need to scrape for median price.
for (const item of items) {
urls.set(item.entry, `${BASE_URL}${item.entry}`);
}
const page = await browser.newPage();
for (const [entry, url] of urls) {
await page.goto(url, { timeout: 5000, waitUntil: 'domcontentloaded' })
.catch(() => {
error = true;
console.log('Could not load page in allowed timoeout: ', url);
});
let error = false;
await page.waitForSelector('.hidden-region-details', {timeout: 1500})
.catch(() => {
error = true;
console.log('Could not find the element with class: .hidden-region-details, likely a bad item: ', url);
});
// If we failed to find a selector that has the data we need to continue on to the next item.
if (error) {
continue;
}
const hiddenRegionDetails = await page.$('.hidden-region-details');
if (hiddenRegionDetails) {
const rows = await hiddenRegionDetails.$$('tr');
// Process and use the extracted elements as needed
for (const row of rows) {
const tdElements = await row.$$('td');
// Only select the row where we have a "Mean" label to get the Mean average type.
let isMean = false;
for (const td of tdElements) {
const tdText = await td.evaluate((element) => element.textContent);
if (tdText === 'Mean') isMean = true; // we have a Mean row, then we need to mark it so we can process the gold and silver elements.
if (isMean) {
const goldSpan = await td.$('.gold');
const silverSpan = await td.$('.silver');
// Gold and Silver are not always guaranteed so we look for both elements and set empty to missing element
if (goldSpan || silverSpan) {
let goldText = goldSpan ? await goldSpan.evaluate((element) => element.textContent) : '';
let silverText = silverSpan ? await silverSpan.evaluate((element) => element.textContent) : '';
// Remove comma formatting to get to raw value of the cost.
if (goldText) {
goldText = goldText?.replace(/,/g, "");
}
if (silverText) {
silverText = silverText?.replace(/,/g, "");
}
// convert gold to copper since all prices in acore_world.item_template are in copper.
let total = 0;
if (goldText) {
total += +goldText * 10000;
}
if (silverText) {
total += +silverText * 100;
}
console.log('Item:', entry, ' Gold: ', goldText, 'g Silver: ', silverText, 's =CopperValue: ', total, 'c');
let sql = 'INSERT INTO market_pricing (entry,cost,human_cost) VALUES ';
sql += `('${entry}', '${total}', '${(goldText) ? goldText : 0}g ${(silverText) ? silverText : 0}s');`;
sqlInsert.push(sql);
sqlDelete.push(entry);
// break;
}
}
}
}
} else {
console.log('Failed to find hidden details on page: ', url);
}
}
// Write the delete statement then the insert statement directly after
const deleteStmt = `DELETE FROM market_pricing WHERE entry IN (${sqlDelete.join(',')};`;
const insertStmt = sqlInsert.join("\n");
try {
fs.writeFileSync(file, `${deleteStmt}\n${insertStmt}`);
browser.close();
return;
} catch (err: any) {
console.error(err.message);
return;
}
}

File diff suppressed because it is too large Load Diff

186
items/cloth.json Normal file
View File

@@ -0,0 +1,186 @@
[
{
"entry": 2589,
"name": "Linen Cloth",
"Quality": 1,
"BuyPrice": 55,
"item": 2589,
"Flags": 0
},
{
"entry": 2592,
"name": "Wool Cloth",
"Quality": 1,
"BuyPrice": 135,
"item": 2592,
"Flags": 0
},
{
"entry": 4306,
"name": "Silk Cloth",
"Quality": 1,
"BuyPrice": 600,
"item": 4306,
"Flags": 0
},
{
"entry": 4338,
"name": "Mageweave Cloth",
"Quality": 1,
"BuyPrice": 1000,
"item": 4338,
"Flags": 0
},
{
"entry": 14256,
"name": "Felcloth",
"Quality": 1,
"BuyPrice": 8000,
"item": 14256,
"Flags": 0
},
{
"entry": 3182,
"name": "Spider's Silk",
"Quality": 1,
"BuyPrice": 1550,
"item": null,
"Flags": 0
},
{
"entry": 4337,
"name": "Thick Spider's Silk",
"Quality": 1,
"BuyPrice": 3000,
"item": null,
"Flags": 0
},
{
"entry": 10285,
"name": "Shadow Silk",
"Quality": 1,
"BuyPrice": 4000,
"item": null,
"Flags": 0
},
{
"entry": 14047,
"name": "Runecloth",
"Quality": 1,
"BuyPrice": 1600,
"item": null,
"Flags": 0
},
{
"entry": 14227,
"name": "Ironweb Spider Silk",
"Quality": 1,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 14342,
"name": "Mooncloth",
"Quality": 1,
"BuyPrice": 16000,
"item": null,
"Flags": 0
},
{
"entry": 21845,
"name": "Primal Mooncloth",
"Quality": 3,
"BuyPrice": 16000,
"item": null,
"Flags": 0
},
{
"entry": 21877,
"name": "Netherweave Cloth",
"Quality": 1,
"BuyPrice": 3200,
"item": null,
"Flags": 0
},
{
"entry": 21881,
"name": "Netherweb Spider Silk",
"Quality": 1,
"BuyPrice": 20000,
"item": null,
"Flags": 0
},
{
"entry": 23854,
"name": "Shadoweave Cloth",
"Quality": 3,
"BuyPrice": 16000,
"item": null,
"Flags": 0
},
{
"entry": 23855,
"name": "Spellfire Cloth",
"Quality": 3,
"BuyPrice": 16000,
"item": null,
"Flags": 0
},
{
"entry": 24271,
"name": "Spellcloth",
"Quality": 3,
"BuyPrice": 16000,
"item": null,
"Flags": 0
},
{
"entry": 24272,
"name": "Shadowcloth",
"Quality": 3,
"BuyPrice": 16000,
"item": null,
"Flags": 0
},
{
"entry": 33470,
"name": "Frostweave Cloth",
"Quality": 1,
"BuyPrice": 5000,
"item": null,
"Flags": 0
},
{
"entry": 41593,
"name": "Ebonweave",
"Quality": 3,
"BuyPrice": 40000,
"item": null,
"Flags": 0
},
{
"entry": 41594,
"name": "Moonshroud",
"Quality": 3,
"BuyPrice": 40000,
"item": null,
"Flags": 0
},
{
"entry": 41595,
"name": "Spellweave",
"Quality": 3,
"BuyPrice": 40000,
"item": null,
"Flags": 0
},
{
"entry": 42253,
"name": "Iceweb Spider Silk",
"Quality": 1,
"BuyPrice": 40000,
"item": null,
"Flags": 0
}
]

File diff suppressed because it is too large Load Diff

786
items/mounts.json Normal file
View File

@@ -0,0 +1,786 @@
[
{
"entry": 8586,
"name": "Whistle of the Mottled Red Raptor",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 12302,
"name": "Reins of the Ancient Frostsaber",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 12303,
"name": "Reins of the Nightsaber",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 12325,
"name": "Reins of the Primal Leopard",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 12326,
"name": "Reins of the Tawny Sabercat",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 12327,
"name": "Reins of the Golden Sabercat",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 12330,
"name": "Horn of the Red Wolf",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 12351,
"name": "Horn of the Arctic Wolf",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 12353,
"name": "White Stallion Bridle",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 12354,
"name": "Palomino Bridle",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 13317,
"name": "Whistle of the Ivory Raptor",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 13323,
"name": "Purple Mechanostrider",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 13324,
"name": "Red and Blue Mechanostrider",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 13326,
"name": "White Mechanostrider Mod B",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 13327,
"name": "Icy Blue Mechanostrider Mod A",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 13328,
"name": "Black Ram",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 13329,
"name": "Frost Ram",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 15292,
"name": "Green Kodo",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 15293,
"name": "Teal Kodo",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 18768,
"name": "Reins of the Swift Dawnsaber",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 21176,
"name": "Black Qiraji Resonating Crystal",
"Quality": 5,
"BuyPrice": 1000000,
"item": null,
"Flags": 32768
},
{
"entry": 21218,
"name": "Blue Qiraji Resonating Crystal",
"Quality": 3,
"BuyPrice": 1000000,
"item": null,
"Flags": 32768
},
{
"entry": 21321,
"name": "Red Qiraji Resonating Crystal",
"Quality": 3,
"BuyPrice": 1000000,
"item": null,
"Flags": 32768
},
{
"entry": 21323,
"name": "Green Qiraji Resonating Crystal",
"Quality": 3,
"BuyPrice": 1000000,
"item": null,
"Flags": 32768
},
{
"entry": 21324,
"name": "Yellow Qiraji Resonating Crystal",
"Quality": 3,
"BuyPrice": 1000000,
"item": null,
"Flags": 32768
},
{
"entry": 28482,
"name": "Great Elite Elekk",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 30609,
"name": "Swift Nether Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 32458,
"name": "Ashes of Al'ar",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 33224,
"name": "Reins of the Spectral Tiger",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 33225,
"name": "Reins of the Swift Spectral Tiger",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 34092,
"name": "Merciless Nether Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 4096
},
{
"entry": 35225,
"name": "X-51 Nether-Rocket",
"Quality": 3,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 35226,
"name": "X-51 Nether-Rocket X-TREME",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 35513,
"name": "Swift White Hawkstrider",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 37598,
"name": "Swift Zhevra OLD",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 37676,
"name": "Vengeful Nether Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 37719,
"name": "Swift Zhevra",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 37827,
"name": "Brewfest Kodo",
"Quality": 3,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 37828,
"name": "Great Brewfest Kodo",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 38576,
"name": "Big Battle Bear",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 40777,
"name": "Polar Bear Harness",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 16
},
{
"entry": 41508,
"name": "Mechano-hog",
"Quality": 4,
"BuyPrice": 50000,
"item": null,
"Flags": 0
},
{
"entry": 43516,
"name": "Brutal Nether Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 43951,
"name": "Reins of the Bronze Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 43952,
"name": "Reins of the Azure Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 43953,
"name": "Reins of the Blue Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 43954,
"name": "Reins of the Twilight Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 43959,
"name": "Reins of the Grand Black War Mammoth",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 43962,
"name": "Reins of the White Polar Bear",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 43963,
"name": "Reins of the Brown Polar Bear",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 43964,
"name": "Reins of the Black Polar Bear",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 43986,
"name": "Reins of the Black Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44083,
"name": "Reins of the Grand Black War Mammoth",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 44151,
"name": "Reins of the Blue Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44160,
"name": "Reins of the Red Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44164,
"name": "Reins of the Black Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44168,
"name": "Reins of the Time-Lost Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44175,
"name": "Reins of the Plagued Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44177,
"name": "Reins of the Violet Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44178,
"name": "Reins of the Albino Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44221,
"name": "Loaned Gryphon Reins",
"Quality": 1,
"BuyPrice": 1000000,
"item": null,
"Flags": 64
},
{
"entry": 44223,
"name": "Reins of the Black War Bear",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 44224,
"name": "Reins of the Black War Bear",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 44229,
"name": "Loaned Wind Rider Reins",
"Quality": 1,
"BuyPrice": 1000000,
"item": null,
"Flags": 64
},
{
"entry": 44413,
"name": "Mekgineer's Chopper",
"Quality": 4,
"BuyPrice": 50000,
"item": null,
"Flags": 0
},
{
"entry": 44558,
"name": "Magnificent Flying Carpet",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44707,
"name": "Reins of the Green Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 44842,
"name": "Red Dragonhawk Mount",
"Quality": 4,
"BuyPrice": 20000000,
"item": null,
"Flags": 0
},
{
"entry": 44843,
"name": "Blue Dragonhawk Mount",
"Quality": 4,
"BuyPrice": 20000000,
"item": null,
"Flags": 0
},
{
"entry": 45693,
"name": "Mimiron's Head",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 45801,
"name": "Reins of the Ironbound Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 45802,
"name": "Reins of the Rusted Proto-Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 46102,
"name": "Whistle of the Venomhide Ravasaur",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 46171,
"name": "Furious Gladiator's Frost Wyrm",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 46708,
"name": "Deadly Gladiator's Frost Wyrm",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 46757,
"name": "Swift Burgundy Wolf",
"Quality": 4,
"BuyPrice": 5000000,
"item": null,
"Flags": 4096
},
{
"entry": 46778,
"name": "Magic Rooster Egg",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 47840,
"name": "Relentless Gladiator's Frost Wyrm",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 49044,
"name": "Swift Alliance Steed",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 49046,
"name": "Swift Horde Wolf",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 49282,
"name": "Big Battle Bear",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 49283,
"name": "Reins of the Spectral Tiger",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 49284,
"name": "Reins of the Swift Spectral Tiger",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 49285,
"name": "X-51 Nether-Rocket",
"Quality": 3,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 49286,
"name": "X-51 Nether-Rocket X-TREME",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 49290,
"name": "Magic Rooster Egg",
"Quality": 4,
"BuyPrice": 1000000,
"item": null,
"Flags": 0
},
{
"entry": 49636,
"name": "Reins of the Onyxian Drake",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 50435,
"name": "Wrathful Gladiator's Frost Wyrm",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 51954,
"name": "Reins of the Bloodbathed Frostbrood Vanquisher",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 51955,
"name": "Reins of the Icebound Frostbrood Vanquisher",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 54068,
"name": "Wooly White Rhino",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 54069,
"name": "Blazing Hippogryph",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 54797,
"name": "Frosty Flying Carpet",
"Quality": 4,
"BuyPrice": 2000000,
"item": null,
"Flags": 0
},
{
"entry": 54860,
"name": "X-53 Touring Rocket",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 62461,
"name": "Goblin Trike Key",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 62462,
"name": "Goblin Turbo-Trike Key",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 73838,
"name": "Mountain Horse",
"Quality": 3,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 73839,
"name": "Swift Mountain Horse",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
}
]

242
items/ore.json Normal file
View File

@@ -0,0 +1,242 @@
[
{
"entry": 2772,
"name": "Iron Ore",
"Quality": 1,
"BuyPrice": 600,
"item": null,
"Flags": 262144
},
{
"entry": 2776,
"name": "Gold Ore",
"Quality": 2,
"BuyPrice": 2000,
"item": null,
"Flags": 0
},
{
"entry": 2835,
"name": "Rough Stone",
"Quality": 1,
"BuyPrice": 8,
"item": null,
"Flags": 0
},
{
"entry": 2836,
"name": "Coarse Stone",
"Quality": 1,
"BuyPrice": 60,
"item": null,
"Flags": 0
},
{
"entry": 2838,
"name": "Heavy Stone",
"Quality": 1,
"BuyPrice": 240,
"item": null,
"Flags": 0
},
{
"entry": 3470,
"name": "Rough Grinding Stone",
"Quality": 1,
"BuyPrice": 20,
"item": null,
"Flags": 0
},
{
"entry": 3478,
"name": "Coarse Grinding Stone",
"Quality": 1,
"BuyPrice": 40,
"item": null,
"Flags": 0
},
{
"entry": 3486,
"name": "Heavy Grinding Stone",
"Quality": 1,
"BuyPrice": 400,
"item": null,
"Flags": 0
},
{
"entry": 3858,
"name": "Mithril Ore",
"Quality": 1,
"BuyPrice": 1000,
"item": null,
"Flags": 262144
},
{
"entry": 7911,
"name": "Truesilver Ore",
"Quality": 2,
"BuyPrice": 2000,
"item": null,
"Flags": 0
},
{
"entry": 7912,
"name": "Solid Stone",
"Quality": 1,
"BuyPrice": 400,
"item": null,
"Flags": 0
},
{
"entry": 7966,
"name": "Solid Grinding Stone",
"Quality": 1,
"BuyPrice": 800,
"item": null,
"Flags": 0
},
{
"entry": 10620,
"name": "Thorium Ore",
"Quality": 1,
"BuyPrice": 1000,
"item": null,
"Flags": 262144
},
{
"entry": 11099,
"name": "Dark Iron Ore",
"Quality": 1,
"BuyPrice": 1000,
"item": null,
"Flags": 16
},
{
"entry": 11370,
"name": "Dark Iron Ore",
"Quality": 1,
"BuyPrice": 2000,
"item": null,
"Flags": 0
},
{
"entry": 12365,
"name": "Dense Stone",
"Quality": 1,
"BuyPrice": 1000,
"item": null,
"Flags": 0
},
{
"entry": 12644,
"name": "Dense Grinding Stone",
"Quality": 1,
"BuyPrice": 800,
"item": null,
"Flags": 0
},
{
"entry": 12809,
"name": "Guardian Stone",
"Quality": 2,
"BuyPrice": 40000,
"item": null,
"Flags": 0
},
{
"entry": 17203,
"name": "Sulfuron Ingot",
"Quality": 4,
"BuyPrice": 400000,
"item": null,
"Flags": 0
},
{
"entry": 18562,
"name": "Elementium Ore",
"Quality": 4,
"BuyPrice": 400000,
"item": null,
"Flags": 0
},
{
"entry": 22202,
"name": "Small Obsidian Shard",
"Quality": 1,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 22203,
"name": "Large Obsidian Shard",
"Quality": 1,
"BuyPrice": 20000,
"item": null,
"Flags": 0
},
{
"entry": 23424,
"name": "Fel Iron Ore",
"Quality": 1,
"BuyPrice": 4000,
"item": null,
"Flags": 262144
},
{
"entry": 23425,
"name": "Adamantite Ore",
"Quality": 1,
"BuyPrice": 6000,
"item": null,
"Flags": 262144
},
{
"entry": 23426,
"name": "Khorium Ore",
"Quality": 2,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 23427,
"name": "Eternium Ore",
"Quality": 2,
"BuyPrice": 5000,
"item": null,
"Flags": 0
},
{
"entry": 35128,
"name": "Hardened Khorium",
"Quality": 2,
"BuyPrice": 45000,
"item": null,
"Flags": 0
},
{
"entry": 36909,
"name": "Cobalt Ore",
"Quality": 1,
"BuyPrice": 4000,
"item": null,
"Flags": 262144
},
{
"entry": 36910,
"name": "Titanium Ore",
"Quality": 2,
"BuyPrice": 5000,
"item": null,
"Flags": 262144
},
{
"entry": 36912,
"name": "Saronite Ore",
"Quality": 1,
"BuyPrice": 10000,
"item": null,
"Flags": 262144
}
]

View File

@@ -0,0 +1,603 @@
[
{
"entry": 17967,
"name": "Refined Scale of Onyxia",
"Quality": 3,
"BuyPrice": 20000,
"item": null,
"Flags": 0
},
{
"entry": 19767,
"name": "Primal Bat Leather",
"Quality": 1,
"BuyPrice": 8000,
"item": null,
"Flags": 0
},
{
"entry": 19768,
"name": "Primal Tiger Leather",
"Quality": 1,
"BuyPrice": 8000,
"item": null,
"Flags": 0
},
{
"entry": 20381,
"name": "Dreamscale",
"Quality": 2,
"BuyPrice": 20000,
"item": null,
"Flags": 0
},
{
"entry": 25649,
"name": "Knothide Leather Scraps",
"Quality": 1,
"BuyPrice": 1000,
"item": null,
"Flags": 0
},
{
"entry": 33567,
"name": "Borean Leather Scraps",
"Quality": 1,
"BuyPrice": 1800,
"item": null,
"Flags": 1088
},
{
"entry": 38557,
"name": "Icy Dragonscale",
"Quality": 1,
"BuyPrice": 40000,
"item": null,
"Flags": 0
},
{
"entry": 38561,
"name": "Jormungar Scale",
"Quality": 1,
"BuyPrice": 40000,
"item": null,
"Flags": 0
},
{
"entry": 49334,
"name": "Scale of Onyxia 2.0",
"Quality": 4,
"BuyPrice": 20000,
"item": null,
"Flags": 0
},
{
"entry": 1288,
"name": "Large Venom Sac",
"Quality": 1,
"BuyPrice": 740,
"item": null,
"Flags": 0
},
{
"entry": 1475,
"name": "Small Venom Sac",
"Quality": 1,
"BuyPrice": 330,
"item": null,
"Flags": 0
},
{
"entry": 2693,
"name": "Stormwind Seasoning Salts",
"Quality": 1,
"BuyPrice": 80,
"item": null,
"Flags": 0
},
{
"entry": 2929,
"name": "Tomb Rot",
"Quality": 1,
"BuyPrice": 10,
"item": null,
"Flags": 0
},
{
"entry": 2932,
"name": "Torment Vine",
"Quality": 1,
"BuyPrice": 200,
"item": null,
"Flags": 0
},
{
"entry": 3164,
"name": "Discolored Worg Heart",
"Quality": 1,
"BuyPrice": 135,
"item": null,
"Flags": 0
},
{
"entry": 4402,
"name": "Small Flame Sac",
"Quality": 1,
"BuyPrice": 1000,
"item": null,
"Flags": 0
},
{
"entry": 4589,
"name": "Long Elegant Feather",
"Quality": 1,
"BuyPrice": 2120,
"item": null,
"Flags": 0
},
{
"entry": 4611,
"name": "Blue Pearl",
"Quality": 1,
"BuyPrice": 200,
"item": null,
"Flags": 0
},
{
"entry": 5635,
"name": "Sharp Claw",
"Quality": 1,
"BuyPrice": 180,
"item": null,
"Flags": 0
},
{
"entry": 5637,
"name": "Large Fang",
"Quality": 1,
"BuyPrice": 300,
"item": null,
"Flags": 0
},
{
"entry": 6358,
"name": "Oily Blackmouth",
"Quality": 1,
"BuyPrice": 16,
"item": null,
"Flags": 0
},
{
"entry": 6359,
"name": "Firefin Snapper",
"Quality": 1,
"BuyPrice": 20,
"item": null,
"Flags": 0
},
{
"entry": 6370,
"name": "Blackmouth Oil",
"Quality": 1,
"BuyPrice": 40,
"item": null,
"Flags": 0
},
{
"entry": 6371,
"name": "Fire Oil",
"Quality": 1,
"BuyPrice": 48,
"item": null,
"Flags": 0
},
{
"entry": 7072,
"name": "Naga Scale",
"Quality": 1,
"BuyPrice": 600,
"item": null,
"Flags": 0
},
{
"entry": 8151,
"name": "Flask of Mojo",
"Quality": 1,
"BuyPrice": 1000,
"item": null,
"Flags": 0
},
{
"entry": 8152,
"name": "Flask of Big Mojo",
"Quality": 1,
"BuyPrice": 2000,
"item": null,
"Flags": 0
},
{
"entry": 9210,
"name": "Ghost Dye",
"Quality": 1,
"BuyPrice": 3000,
"item": null,
"Flags": 0
},
{
"entry": 9262,
"name": "Black Vitriol",
"Quality": 1,
"BuyPrice": 4000,
"item": null,
"Flags": 0
},
{
"entry": 12662,
"name": "Demonic Rune",
"Quality": 2,
"BuyPrice": 2400,
"item": null,
"Flags": 0
},
{
"entry": 12804,
"name": "Powerful Mojo",
"Quality": 1,
"BuyPrice": 8000,
"item": null,
"Flags": 0
},
{
"entry": 12811,
"name": "Righteous Orb",
"Quality": 2,
"BuyPrice": 80000,
"item": null,
"Flags": 0
},
{
"entry": 13422,
"name": "Stonescale Eel",
"Quality": 1,
"BuyPrice": 40,
"item": null,
"Flags": 0
},
{
"entry": 13423,
"name": "Stonescale Oil",
"Quality": 1,
"BuyPrice": 500,
"item": null,
"Flags": 0
},
{
"entry": 13503,
"name": "Alchemist's Stone",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 13757,
"name": "Lightning Eel",
"Quality": 1,
"BuyPrice": 1200,
"item": null,
"Flags": 0
},
{
"entry": 17010,
"name": "Fiery Core",
"Quality": 3,
"BuyPrice": 8000,
"item": null,
"Flags": 0
},
{
"entry": 17011,
"name": "Lava Core",
"Quality": 3,
"BuyPrice": 8000,
"item": null,
"Flags": 0
},
{
"entry": 18512,
"name": "Larval Acid",
"Quality": 1,
"BuyPrice": 16000,
"item": null,
"Flags": 0
},
{
"entry": 19441,
"name": "Huge Venom Sac",
"Quality": 1,
"BuyPrice": 6000,
"item": null,
"Flags": 0
},
{
"entry": 19943,
"name": "Massive Mojo",
"Quality": 1,
"BuyPrice": 8000,
"item": null,
"Flags": 0
},
{
"entry": 20520,
"name": "Dark Rune",
"Quality": 2,
"BuyPrice": 8000,
"item": null,
"Flags": 0
},
{
"entry": 21882,
"name": "Soul Essence",
"Quality": 1,
"BuyPrice": 10000,
"item": null,
"Flags": 0
},
{
"entry": 22682,
"name": "Frozen Rune",
"Quality": 3,
"BuyPrice": 80000,
"item": null,
"Flags": 0
},
{
"entry": 24288,
"name": "Rune Thread",
"Quality": 3,
"BuyPrice": 60000,
"item": null,
"Flags": 0
},
{
"entry": 32428,
"name": "Heart of Darkness",
"Quality": 3,
"BuyPrice": 80000,
"item": null,
"Flags": 0
},
{
"entry": 34664,
"name": "Sunmote",
"Quality": 3,
"BuyPrice": 90000,
"item": null,
"Flags": 0
},
{
"entry": 35748,
"name": "Guardian's Alchemist Stone",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 35749,
"name": "Sorcerer's Alchemist Stone",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 35750,
"name": "Redeemer's Alchemist Stone",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 35751,
"name": "Assassin's Alchemist Stone",
"Quality": 4,
"BuyPrice": 100000,
"item": null,
"Flags": 0
},
{
"entry": 39151,
"name": "Alabaster Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 39334,
"name": "Dusky Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 39338,
"name": "Golden Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 39339,
"name": "Emerald Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 39340,
"name": "Violet Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 39341,
"name": "Silvery Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 39342,
"name": "Nether Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 39343,
"name": "Azure Pigment",
"Quality": 1,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 40195,
"name": "Pygmy Oil",
"Quality": 1,
"BuyPrice": 3000,
"item": null,
"Flags": 0
},
{
"entry": 40199,
"name": "Pygmy Suckerfish",
"Quality": 1,
"BuyPrice": 200,
"item": null,
"Flags": 0
},
{
"entry": 42170,
"name": "Silver Brooch",
"Quality": 1,
"BuyPrice": 200000,
"item": null,
"Flags": 0
},
{
"entry": 42171,
"name": "Emerald Brooch",
"Quality": 1,
"BuyPrice": 500000,
"item": null,
"Flags": 0
},
{
"entry": 43103,
"name": "Verdant Pigment",
"Quality": 2,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 43104,
"name": "Burnt Pigment",
"Quality": 2,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 43105,
"name": "Indigo Pigment",
"Quality": 2,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 43106,
"name": "Ruby Pigment",
"Quality": 2,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 43107,
"name": "Sapphire Pigment",
"Quality": 2,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 43108,
"name": "Ebon Pigment",
"Quality": 2,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 43109,
"name": "Icy Pigment",
"Quality": 2,
"BuyPrice": 100,
"item": null,
"Flags": 0
},
{
"entry": 44322,
"name": "Mercurial Alchemist Stone",
"Quality": 3,
"BuyPrice": 322031,
"item": null,
"Flags": 0
},
{
"entry": 44323,
"name": "Indestructible Alchemist's Stone",
"Quality": 3,
"BuyPrice": 322031,
"item": null,
"Flags": 0
},
{
"entry": 44324,
"name": "Mighty Alchemist's Stone",
"Quality": 3,
"BuyPrice": 322031,
"item": null,
"Flags": 0
},
{
"entry": 44852,
"name": "Cornmeal",
"Quality": 1,
"BuyPrice": 25,
"item": null,
"Flags": 0
},
{
"entry": 44958,
"name": "Ethereal Oil",
"Quality": 1,
"BuyPrice": 40,
"item": null,
"Flags": 0
}
]

1936
items/tradegoods.json Normal file

File diff suppressed because it is too large Load Diff

10
mounts.ts Normal file
View File

@@ -0,0 +1,10 @@
import { merge } from "lodash";
// import { minePricing } from "./data-miners/minePriceNexus";
import { minePricing } from "./data-miners/minePricingUndermine";
import ore from "./items/mounts.json";
(async () => {
await minePricing(ore, './sql/acore_world/mp_mounts_undermine.sql');
})();

8
ore.ts Normal file
View File

@@ -0,0 +1,8 @@
import { merge } from "lodash";
import { minePricing } from "./data-miners/minePriceNexus";
import ore from "./items/ore.json";
(async () => {
await minePricing(ore, './sql/acore_world/mp_ore_nexus.sql');
})();

28
package.json Normal file
View File

@@ -0,0 +1,28 @@
{
"name": "wow-market-place-miner",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node node_modules/ts-node/dist/bin.js ./auction-prices.ts"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^20.5.7",
"axios": "^1.5.0",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
},
"dependencies": {
"@octokit/rest": "^20.0.1",
"@types/lodash.merge": "^4.6.7",
"cheerio": "^1.0.0-rc.12",
"github": "^14.0.0",
"lodash": "^4.17.21",
"lodash.merge": "^4.6.2",
"puppeteer": "^21.1.0",
"sleep-promise": "^9.1.0"
}
}

7
special_tradegoods.ts Normal file
View File

@@ -0,0 +1,7 @@
import { minePricing } from "./data-miners/minePriceNexus";
import items from "./items/specialty_tradegoods.json";
(async () => {
await minePricing(items, './sql/acore_world/mp_special_goods_nexus.sql');
})();

7
tradegoods.ts Normal file
View File

@@ -0,0 +1,7 @@
import tradegoods from "./items/tradegoods.json";
import { minePricing } from "./data-miners/minePriceNexus";
(async () => {
await minePricing(tradegoods, './sql/acore_world/mp_tradegoods_nexus.sql');
})();

14
tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"module": "commonjs", /* Specify what module code is generated. */
"resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
"resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
"resolveJsonModule": true, /* Enable importing .json files. */
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
"strict": true, /* Enable all strict type-checking options. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}