diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-09-04 20:13:20 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-09-04 20:13:20 +0100 |
commit | fdab57f966a3928852701a2e41d75499f8f828ac (patch) | |
tree | d6803666d981e6fc3bd9acc65d6a14e3a55af823 /src/uaLookup.hpp | |
parent | 421e9aa1f92b21eb1fc3a98b77a2a181afd7180e (diff) | |
download | webstat-fdab57f966a3928852701a2e41d75499f8f828ac.tar.bz2 webstat-fdab57f966a3928852701a2e41d75499f8f828ac.tar.xz webstat-fdab57f966a3928852701a2e41d75499f8f828ac.zip |
Add function to grab UA details from useragentstring.com
Diffstat (limited to 'src/uaLookup.hpp')
-rw-r--r-- | src/uaLookup.hpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/uaLookup.hpp b/src/uaLookup.hpp new file mode 100644 index 0000000..5492f05 --- /dev/null +++ b/src/uaLookup.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include <curl/curl.h> +#include <stdexcept> +#include <string> + +namespace WebStat { + class CurlError : public std::runtime_error { + public: + explicit CurlError(CURLcode code, const char * msg) : std::runtime_error {msg}, code(code) { } + + CURLcode code; + }; + + std::string getUserAgentDetail(std::string_view uas, const char * baseUrl = "https://useragentstring.com"); +} |