kopia lustrzana https://gitlab.com/tomaszg/geostat
Get ratings from OKapi
rodzic
3a3c275954
commit
e6909c1575
1
cache.h
1
cache.h
|
@ -62,6 +62,7 @@ public:
|
|||
float terr = 0;
|
||||
int fav = 0;
|
||||
int founds = 0;
|
||||
float rating = 0;
|
||||
bool recommended = 0; // was the cache recommended by that user?
|
||||
std::string type;
|
||||
std::string region;
|
||||
|
|
|
@ -93,7 +93,7 @@ void Okapi::get_user_caches_json(const std::string& uuid, int count, int offset)
|
|||
|
||||
void Okapi::get_caches_json(const std::string& codes) const {
|
||||
std::string service = url + OKAPI_caches;
|
||||
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner|region|size2|date_created|recommendations|founds|status";
|
||||
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner|region|size2|date_created|recommendations|rating|founds|status";
|
||||
curl_post(service, query);
|
||||
}
|
||||
|
||||
|
@ -157,6 +157,7 @@ Caches Okapi::get_caches(const std::set<std::string>& codes) const {
|
|||
c.pos = Position(el.value()["location"]);
|
||||
c.origin = service;
|
||||
c.fav = el.value()["recommendations"];
|
||||
if (!el.value()["rating"].is_null()) c.rating = el.value()["rating"];
|
||||
c.founds = el.value()["founds"];
|
||||
|
||||
if (el.value()["status"] == "Available")
|
||||
|
|
Ładowanie…
Reference in New Issue