diff options
| author | Aotrix <[email protected]> | 2026-02-07 23:30:06 +0100 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2026-02-07 23:30:06 +0100 |
| commit | 2f698c83b6f5271f8753b69bfcd9aa3a6d532a50 (patch) | |
| tree | ebb2fc7295e5387341e1f02f4d5f8fc386f31120 /battleNetApi/src/main.cpp | |
| parent | bace986e441fc02b1ec9c9c3096fea1e5529aa52 (diff) | |
Add a generic function to set ApiUrl parameters
Diffstat (limited to 'battleNetApi/src/main.cpp')
| -rw-r--r-- | battleNetApi/src/main.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/battleNetApi/src/main.cpp b/battleNetApi/src/main.cpp index 4e3885b..43245d8 100644 --- a/battleNetApi/src/main.cpp +++ b/battleNetApi/src/main.cpp @@ -13,15 +13,20 @@ int main(int argc, char *argv[]) { Token aToken(aCredentialsFilePath); HearthstoneApi aHearthstoneApi(aToken); std::string aOutputPath{argv[2]}; - const std::string kContentType{"cards"}; - const std::string kRegion{"eu"}; - ApiUrl aApiUrl(kContentType, kRegion); - aApiUrl.setLocale("fr_FR"); - aApiUrl.setGameMode("constructed"); - aApiUrl.setPageSize("100"); - std::cout << "Downloading cards...\n"; - aHearthstoneApi.downloadAllCards(aApiUrl, aOutputPath); - std::cout << "Download done.\n"; + + if (argc < 4) { + const std::string kContentType{"cards"}; + const std::string kRegion{"eu"}; + ApiUrl aApiUrl(kContentType, kRegion); + aApiUrl.setLocale("fr_FR"); + aApiUrl.setGameMode("constructed"); + aApiUrl.setPageSize("100"); + std::cout << "Downloading cards...\n"; + aHearthstoneApi.downloadAllCards(aApiUrl, aOutputPath); + std::cout << "Download done.\n"; + } else { + // TODO: retrieve config from JSON file + } return 0; } |
