#include "GamesDBScraper.h" #include "../components/AsyncReqComponent.h" std::vector GamesDBScraper::getResults(ScraperSearchParams params) { std::shared_ptr req = makeHttpReq(); while(req->status() == HttpReq::REQ_IN_PROGRESS); return parseReq(params, req); } std::shared_ptr GamesDBScraper::makeHttpReq() { return std::make_shared("cdn.garcya.us", "/wp-content/uploads/2010/04/TD250.jpg"); } std::vector GamesDBScraper::parseReq(ScraperSearchParams params, std::shared_ptr req) { std::vector mdl; return mdl; } void GamesDBScraper::getResultsAsync(ScraperSearchParams params, Window* window, std::function)> returnFunc) { std::shared_ptr httpreq = makeHttpReq(); AsyncReqComponent* req = new AsyncReqComponent(window, httpreq, [this, params, returnFunc] (std::shared_ptr r) { returnFunc(parseReq(params, r)); }, [] () { }); window->pushGui(req); }