// SPDX-License-Identifier: MIT // // ES-DE Frontend // GamesDBJSONScraper.h // // Functions specifically for scraping from thegamesdb.net // Called from Scraper. // #ifndef ES_APP_SCRAPERS_GAMES_DB_JSON_SCRAPER_H #define ES_APP_SCRAPERS_GAMES_DB_JSON_SCRAPER_H #include "scrapers/Scraper.h" namespace pugi { class xml_document; } void thegamesdb_generate_json_scraper_requests( const ScraperSearchParams& params, std::queue>& requests, std::vector& results); void thegamesdb_generate_json_scraper_requests( const std::string& gameIDs, std::queue>& requests, std::vector& results); class TheGamesDBJSONRequest : public ScraperHttpRequest { public: TheGamesDBJSONRequest(std::queue>& requestsWrite, std::vector& resultsWrite, const std::string& url) : ScraperHttpRequest(resultsWrite, url) , mRequestQueue(&requestsWrite) { } TheGamesDBJSONRequest(std::vector& resultsWrite, const std::string& url) : ScraperHttpRequest(resultsWrite, url) , mRequestQueue(nullptr) { } protected: void process(const std::unique_ptr& req, std::vector& results) override; bool isGameRequest() { return !mRequestQueue; } std::queue>* mRequestQueue; }; #endif // ES_APP_SCRAPERS_GAMES_DB_JSON_SCRAPER_H