blob: bcd5eefa39c704a26c4de68e8bcf100b218cb221 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#ifndef INVAPI_H
#define INVAPI_H
#include <string>
#include <vector>
#include <cpr/cpr.h>
#include "sqliteinterface.hpp"
class InvidiousApi {
public:
struct instance {
std::string url;
float health;
std::string location;
};
InvidiousApi(const std::string& url) : instanceUrl(url) {};
static std::vector<std::string> getInstancesUrls();
static std::vector<instance> getInstances();
static void saveInstancesToDb(SqliteInterface& sqldb);
static std::string getInstanceUrlFromDb(SqliteInterface& sqldb);
std::string getInstance();
void setInstance(const std::string& newUrl);
void test();
private:
std::string instanceUrl;
cpr::Session session;
};
#endif
|