From 6706ef98985bed36029309f5bf2e4e9575cdfc0f Mon Sep 17 00:00:00 2001 From: Tomasz Golinski Date: Mon, 18 Jul 2022 19:36:46 +0200 Subject: [PATCH] Grab more data about powertrails (type, active caches) --- powertrail.cpp | 25 ++++++++++++++++++++++--- powertrail.h | 14 ++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/powertrail.cpp b/powertrail.cpp index 9c827c5..7664e96 100644 --- a/powertrail.cpp +++ b/powertrail.cpp @@ -15,19 +15,22 @@ static const std::string url = "https://opencaching.pl/powerTrail.php?ptAction=s static const std::string url2 = "https://opencaching.pl/powerTrail/ajaxGetPowerTrailCaches.php?ptAction=showSerie&ptrail="; static const std::regex regex_name("(.*?)"); +static const std::regex regex_type("(.*?)"); static const std::regex regex_date("(.*?)"); static const std::regex regex_perc("(.*?)"); -static const std::regex regex_cache(""); +static const std::regex regex_cache(".*? caches; + uint active_caches = 0; + uint found = 0; bool completed = 0; std::string link() const; std::string link_name() const; std::string safe_name() const; + std::string get_type() const; + + inline static const std::string types[] = { "geo-szkic", "krajoznawcza", "przyrodnicza", "tematyczna", "nieznany" }; }; class PowertrailDB {