#include "apiUrl.hpp" #include #include #include int main(int argc, char *argv[]) { if (argc < 3) { // Example of parameters: // ./build/downloadCards tests/resources/credentials.json build/output.json throw std::invalid_argument("/ "); } std::string aCredentialsFilePath{argv[1]}; 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"; return 0; }