diff --git a/src/api/games/collection.ts b/src/api/games/collection.ts index 17c3eff..4814668 100644 --- a/src/api/games/collection.ts +++ b/src/api/games/collection.ts @@ -1,4 +1,3 @@ -import { writeFileSync } from 'node:fs' import { ofetch } from 'ofetch' import { xmlParser , mergeAttributes } from '../../utils/parser' import { Collection } from 'src/types/collection' @@ -50,6 +49,6 @@ export async function findCollection(userName: string) { const response = await ofetch( `https://www.boardgamegeek.com/xmlapi/collection/${userName}?${searchParams}` ) - writeFileSync('logs/collection.xml', response) + // writeFileSync('logs/collection.xml', response) parseCollection(response) } diff --git a/src/api/games/find-game-by-id.ts b/src/api/games/find-game-by-id.ts index d2a6cc6..a6c05a2 100644 --- a/src/api/games/find-game-by-id.ts +++ b/src/api/games/find-game-by-id.ts @@ -1,4 +1,3 @@ -import { writeFileSync } from 'node:fs' import { ofetch } from 'ofetch' import { mergeAttributes, parsePoll, xmlParser } from '../../utils/parser.js' import { renameProperties } from '../../utils/names.js' @@ -34,11 +33,11 @@ export function parseFindGameByIds(xmlString: string) { const resultParsed = xmlParser.parse(xmlString) // writeFileSync('logs/find-game-by-ids-parsed-xml.json', JSON.stringify(resultParsed, undefined, 2)); const resultMerged = mergeAttributes(resultParsed) - writeFileSync('logs/find-game-by-ids-merged.json', JSON.stringify(resultMerged, undefined, 2)); + // writeFileSync('logs/find-game-by-ids-merged.json', JSON.stringify(resultMerged, undefined, 2)); const games = resultMerged.boardgames.boardgame.map( (game: Record) => parseFindGameByIdGame(game) ) - writeFileSync('logs/find-game-by-ids.json', JSON.stringify(games, undefined, 2)); + // writeFileSync('logs/find-game-by-ids.json', JSON.stringify(games, undefined, 2)); return games } @@ -100,7 +99,7 @@ export async function findGameByIds(ids: number[], options: findGameByIdOptions const response = await ofetch( `https://www.boardgamegeek.com/xmlapi/boardgame/${ids.join(',')}?${searchParams}` ) - writeFileSync('logs/find-game-by-ids.xml', response); + // writeFileSync('logs/find-game-by-ids.xml', response); const result = parseFindGameByIds(response) return result } \ No newline at end of file diff --git a/src/api/games/search.ts b/src/api/games/search.ts index ff8462c..9974797 100644 --- a/src/api/games/search.ts +++ b/src/api/games/search.ts @@ -1,4 +1,3 @@ -import { writeFileSync } from 'node:fs' import { ofetch } from 'ofetch' import { mergeAttributes, xmlParser } from '../../utils/parser' @@ -39,11 +38,11 @@ export function parseSearchGame(xmlString: string): GameSearchResult[] { if (!resultMerged.boardgames.boardgame) return [] - writeFileSync('logs/search-merged.json', JSON.stringify(resultMerged, undefined, 2)); + // writeFileSync('logs/search-merged.json', JSON.stringify(resultMerged, undefined, 2)); const games = resultMerged.boardgames.boardgame.map( (boardGame: MergedResultGame) => parseBoardGame(boardGame) ) - writeFileSync('logs/search.json', JSON.stringify(games, undefined, 2)); + // writeFileSync('logs/search.json', JSON.stringify(games, undefined, 2)); return games } @@ -52,6 +51,6 @@ export async function findGame(name: string) { search: name, }) const response = await ofetch(`https://www.boardgamegeek.com/xmlapi/search?${searchParams}`) - writeFileSync('logs/search.xml', response); + // writeFileSync('logs/search.xml', response); parseSearchGame(response) }