kopia lustrzana https://gitlab.com/tomaszg/geostat
Move some constants (like urls) to common.h
rodzic
277cdc058e
commit
d00a852295
18
common.h
18
common.h
|
@ -5,6 +5,24 @@
|
|||
|
||||
#include <functional>
|
||||
|
||||
const std::string ocpl_url = "https://opencaching.pl/okapi/";
|
||||
const std::string ocde_url = "https://www.opencaching.de/okapi/";
|
||||
const std::string ocus_url = "http://www.opencaching.us/okapi/";
|
||||
const std::string ocnl_url = "http://www.opencaching.nl/okapi/";
|
||||
const std::string ocro_url = "http://www.opencaching.ro/okapi/";
|
||||
const std::string ocuk_url = "https://opencache.uk/okapi/";
|
||||
|
||||
const std::string flag_pl = "https://wiki.opencaching.eu/images/b/b7/Oc-pl.png";
|
||||
const std::string flag_de = "https://wiki.opencaching.eu/images/c/c1/Oc-de.png";
|
||||
const std::string flag_us = "https://wiki.opencaching.eu/images/f/fb/Oc-us.png";
|
||||
const std::string flag_nl = "https://wiki.opencaching.eu/images/4/4b/Oc-nl.png";
|
||||
const std::string flag_ro = "https://wiki.opencaching.eu/images/4/4f/Oc-ro.png";
|
||||
const std::string flag_uk = "https://wiki.opencaching.eu/images/5/58/Oc-org-uk.png";
|
||||
|
||||
const std::string Database_pl = "ocpl.sqlite";
|
||||
const std::string Database_de = "ocde.sqlite";
|
||||
const std::string Database_us = "ocus.sqlite";
|
||||
|
||||
void htmlencode(std::string& data);
|
||||
|
||||
void show_histogram(const Caches& cc, std::string Cache::*ptr, const std::string& caption, bool html = 0, bool sort_by_val = 1);
|
||||
|
|
11
geodb.cpp
11
geodb.cpp
|
@ -1,6 +1,7 @@
|
|||
#include "debug.h"
|
||||
#include "ocdb.h"
|
||||
#include "okapi.h"
|
||||
#include "common.h"
|
||||
|
||||
#include "config_user_key.h"
|
||||
|
||||
|
@ -12,16 +13,6 @@
|
|||
|
||||
using json = nlohmann::json;
|
||||
|
||||
const std::string Database_pl = "ocpl.sqlite";
|
||||
const std::string Database_de = "ocde.sqlite";
|
||||
const std::string Database_us = "ocus.sqlite";
|
||||
const std::string ocpl_url = "https://opencaching.pl/okapi/";
|
||||
const std::string ocde_url = "https://www.opencaching.de/okapi/";
|
||||
const std::string ocus_url = "http://www.opencaching.us/okapi/";
|
||||
// const std::string ocnl_url = "http://www.opencaching.nl/okapi/";
|
||||
// const std::string ocro_url = "http://www.opencaching.ro/okapi/";
|
||||
// const std::string ocuk_url = "https://opencache.uk/okapi/";
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
std::string Dump_path;
|
||||
std::string Database;
|
||||
|
|
|
@ -13,7 +13,6 @@ void show_usage() {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
std::string ocpl_url = "https://opencaching.pl/okapi/";
|
||||
|
||||
#include "config_user.h"
|
||||
|
||||
|
|
|
@ -13,12 +13,6 @@ void show_usage() {
|
|||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
std::string ocpl_url = "https://opencaching.pl/okapi/";
|
||||
std::string ocde_url = "https://www.opencaching.de/okapi/";
|
||||
std::string ocus_url = "http://www.opencaching.us/okapi/";
|
||||
std::string ocnl_url = "http://www.opencaching.nl/okapi/";
|
||||
std::string ocro_url = "http://www.opencaching.ro/okapi/";
|
||||
std::string ocuk_url = "https://opencache.uk/okapi/";
|
||||
|
||||
#include "config_user.h"
|
||||
|
||||
|
|
23
geostat.cpp
23
geostat.cpp
|
@ -73,17 +73,6 @@ int main(int argc, char** argv) {
|
|||
std::string ocro_user_profile;
|
||||
std::string ocuk_user_profile;
|
||||
|
||||
std::string ocpl_url = "https://opencaching.pl/okapi/";
|
||||
std::string ocde_url = "https://www.opencaching.de/okapi/";
|
||||
std::string ocus_url = "http://www.opencaching.us/okapi/";
|
||||
std::string ocnl_url = "http://www.opencaching.nl/okapi/";
|
||||
std::string ocro_url = "http://www.opencaching.ro/okapi/";
|
||||
std::string ocuk_url = "https://opencache.uk/okapi/";
|
||||
|
||||
const std::string Database_pl = "ocpl.sqlite";
|
||||
const std::string Database_de = "ocde.sqlite";
|
||||
const std::string Database_us = "ocus.sqlite";
|
||||
|
||||
// std::string gpx_file;
|
||||
|
||||
#include "config_user.h"
|
||||
|
@ -400,17 +389,17 @@ int main(int argc, char** argv) {
|
|||
std::cout << "<header>\n";
|
||||
std::cout << "<h1><a href=\"/geo\">Geocaching stats</a> for user profiles:</h1>\n";
|
||||
if (!ocpl_user.empty())
|
||||
std::cout << "<img alt=\"OCpl\" src=\"https://wiki.opencaching.eu/images/b/b7/Oc-pl.png\"> <a href=\"" << ocpl_user_profile << "\">" << ocpl_user << "</a><br>\n";
|
||||
std::cout << "<img alt=\"OCpl\" src=\"" << flag_pl << "\"> <a href=\"" << ocpl_user_profile << "\">" << ocpl_user << "</a><br>\n";
|
||||
if (!ocde_user.empty())
|
||||
std::cout << "<img alt=\"OCde\" src=\"https://wiki.opencaching.eu/images/c/c1/Oc-de.png\"> <a href=\"" << ocde_user_profile << "\">" << ocde_user << "</a><br>\n";
|
||||
std::cout << "<img alt=\"OCde\" src=\"" << flag_de << "\"> <a href=\"" << ocde_user_profile << "\">" << ocde_user << "</a><br>\n";
|
||||
if (!ocus_user.empty())
|
||||
std::cout << "<img alt=\"OCna\" src=\"https://wiki.opencaching.eu/images/f/fb/Oc-us.png\"> <a href=\"" << ocus_user_profile << "\">" << ocus_user << "</a><br>\n";
|
||||
std::cout << "<img alt=\"OCna\" src=\"" << flag_us << "\"> <a href=\"" << ocus_user_profile << "\">" << ocus_user << "</a><br>\n";
|
||||
if (!ocnl_user.empty())
|
||||
std::cout << "<img alt=\"OCnl\" src=\"https://wiki.opencaching.eu/images/4/4b/Oc-nl.png\"> <a href=\"" << ocnl_user_profile << "\">" << ocnl_user << "</a><br>\n";
|
||||
std::cout << "<img alt=\"OCnl\" src=\"" << flag_nl << "\"> <a href=\"" << ocnl_user_profile << "\">" << ocnl_user << "</a><br>\n";
|
||||
if (!ocro_user.empty())
|
||||
std::cout << "<img alt=\"OCro\" src=\"https://wiki.opencaching.eu/images/4/4f/Oc-ro.png\"> <a href=\"" << ocro_user_profile << "\">" << ocro_user << "</a><br>\n";
|
||||
std::cout << "<img alt=\"OCro\" src=\"" << flag_ro << "\"> <a href=\"" << ocro_user_profile << "\">" << ocro_user << "</a><br>\n";
|
||||
if (!ocuk_user.empty())
|
||||
std::cout << "<img alt=\"OCuk\" src=\"https://wiki.opencaching.eu/images/5/58/Oc-org-uk.png\"> <a href=\"" << ocuk_user_profile << "\">" << ocuk_user << "</a><br>\n";
|
||||
std::cout << "<img alt=\"OCuk\" src=\"" << flag_uk << "\"> <a href=\"" << ocuk_user_profile << "\">" << ocuk_user << "</a><br>\n";
|
||||
|
||||
if (time_filter) {
|
||||
std::cout << "for time range " << std::put_time(std::localtime(&start_time), "%x") << "—" << std::put_time(std::localtime(&end_time), "%x");
|
||||
|
|
|
@ -70,17 +70,6 @@ int main(int argc, char** argv) {
|
|||
std::string ocro_user;
|
||||
std::string ocuk_user;
|
||||
|
||||
std::string ocpl_url = "https://opencaching.pl/okapi/";
|
||||
std::string ocde_url = "https://www.opencaching.de/okapi/";
|
||||
std::string ocus_url = "http://www.opencaching.us/okapi/";
|
||||
std::string ocnl_url = "http://www.opencaching.nl/okapi/";
|
||||
std::string ocro_url = "http://www.opencaching.ro/okapi/";
|
||||
std::string ocuk_url = "https://opencache.uk/okapi/";
|
||||
|
||||
const std::string Database_pl = "ocpl.sqlite";
|
||||
const std::string Database_de = "ocde.sqlite";
|
||||
const std::string Database_us = "ocus.sqlite";
|
||||
|
||||
std::string gpx_file;
|
||||
|
||||
#include "config_user.h"
|
||||
|
|
Ładowanie…
Reference in New Issue