blob: bcd5eefa39c704a26c4de68e8bcf100b218cb221 (
plain) (
tree)
|
|
#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
|