Updated example
parent
8d0a30649e
commit
edc8f96277
|
@ -30,13 +30,20 @@ async function main() {
|
||||||
// Log in the platform
|
// Log in the platform
|
||||||
console.log("Authenticating...");
|
console.log("Authenticating...");
|
||||||
const result = await F95API.login(process.env.F95_USERNAME, process.env.F95_PASSWORD);
|
const result = await F95API.login(process.env.F95_USERNAME, process.env.F95_PASSWORD);
|
||||||
console.log(`Authentication result: ${result.message}`);
|
console.log(`Authentication result: ${result.message}\n`);
|
||||||
|
|
||||||
// Get user data
|
// Get user data
|
||||||
console.log("Fetching user data...");
|
console.log("Fetching user data...");
|
||||||
const userdata = await F95API.getUserData();
|
const userdata = await F95API.getUserData();
|
||||||
console.log(`${userdata.username} follows ${userdata.watchedGameThreads.length} threads`);
|
console.log(`${userdata.username} follows ${userdata.watchedGameThreads.length} threads\n`);
|
||||||
|
|
||||||
|
// Get latest game update
|
||||||
|
const latestUpdates = await F95API.getLatestUpdates({
|
||||||
|
tags: ["3d game"]
|
||||||
|
}, 1);
|
||||||
|
console.log(`"${latestUpdates[0].name}" was the last "3d game" tagged game to be updated\n`);
|
||||||
|
|
||||||
|
// Get game data
|
||||||
for(const gamename of gameList) {
|
for(const gamename of gameList) {
|
||||||
console.log(`Searching '${gamename}'...`);
|
console.log(`Searching '${gamename}'...`);
|
||||||
const found = await F95API.getGameData(gamename, false);
|
const found = await F95API.getGameData(gamename, false);
|
||||||
|
@ -49,6 +56,6 @@ async function main() {
|
||||||
|
|
||||||
// Extract first game
|
// Extract first game
|
||||||
const gamedata = found[0];
|
const gamedata = found[0];
|
||||||
console.log(`Found ${gamedata.name} (${gamedata.version}) by ${gamedata.author}`);
|
console.log(`Found: ${gamedata.name} (${gamedata.version}) by ${gamedata.author}\n`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue