kopia lustrzana https://gitlab.com/tomaszg/geostat
Fetch regions and print out histogram
rodzic
25b407f02f
commit
1942df93e5
1
cache.h
1
cache.h
|
@ -46,6 +46,7 @@ public:
|
|||
float diff;
|
||||
float terr;
|
||||
std::string type;
|
||||
std::string region;
|
||||
std::string origin;
|
||||
std::string owner;
|
||||
std::string owner_uuid;
|
||||
|
|
|
@ -197,8 +197,11 @@ int main(int argc, char** argv) {
|
|||
std::cout << "Types:\n";
|
||||
show_histogram(&cc, &Cache::type);
|
||||
|
||||
std::cout << "\nService:\n";
|
||||
std::cout << "\nServices:\n";
|
||||
show_histogram(&cc, &Cache::origin);
|
||||
|
||||
std::cout << "\nRegions:\n";
|
||||
show_histogram(&cc, &Cache::region);
|
||||
}
|
||||
|
||||
if (show_dt) {
|
||||
|
|
|
@ -72,7 +72,7 @@ std::string Okapi::get_user_caches_json(std::string uuid, int count, int offset)
|
|||
|
||||
std::string Okapi::get_caches_json(std::string codes) {
|
||||
std::string service = url + OKAPI_caches;
|
||||
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner";
|
||||
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner|region";
|
||||
return curl_post(service, query);
|
||||
}
|
||||
|
||||
|
@ -120,6 +120,7 @@ Caches Okapi::get_caches(std::vector<std::string> codes) {
|
|||
c.code = el.value()["code"];
|
||||
c.name = el.value()["name"];
|
||||
c.type = el.value()["type"];
|
||||
c.region = el.value()["region"];
|
||||
c.diff = el.value()["difficulty"];
|
||||
c.terr = el.value()["terrain"];
|
||||
c.owner = el.value()["owner"]["username"];
|
||||
|
|
Ładowanie…
Reference in New Issue