F95API/test/user-test.js

22 lines
588 B
JavaScript
Raw Normal View History

2020-10-31 15:00:26 +00:00
"use strict";
2020-09-29 15:11:43 +00:00
2020-10-31 15:00:26 +00:00
// Modules from file
const searcher = require("../plain-html/scripts/searcher.js");
const scraper = require("../plain-html/scripts/scraper.js");
2020-09-29 15:11:43 +00:00
2020-10-31 15:00:26 +00:00
// Search for Kingdom Of Deception data
searchKOD();
2020-09-29 15:11:43 +00:00
2020-10-31 15:00:26 +00:00
async function searchKOD() {
console.log("Searching KOD...");
const urls = await searcher.searchGame("kingdom of deception");
console.log(`Found: ${urls}`);
console.log("Scraping data...");
for (const url of urls) {
const gamedata = await scraper.getGameInfo(url);
console.log(gamedata);
2020-10-29 21:14:40 +00:00
}
2020-10-31 15:00:26 +00:00
console.log("Scraping completed!");
}