requests to ofd

This commit is contained in:
2024-11-27 01:46:36 +03:00
parent 1843479e6b
commit 47dfc19395
9 changed files with 125 additions and 33 deletions

View File

@@ -6,8 +6,21 @@
#include <curl/curl.h>
#include <iostream>
#include <filesystem>
#include <fstream>
int main(int argc, char *argv[]) {
// std::ifstream test_file("/home/leca/projects/qt/checks-parser/test.html");
// std::string content;
// std::string str;
// while(getline(test_file, str)) {
// content += str + "\n";
// }
// parseOfdRuAnswer(content);
// return 0;
curl_global_init(CURL_GLOBAL_ALL);
std::string program_data_path = get_path_relative_to_home(".local/share/checks_parser");
@@ -19,20 +32,8 @@ int main(int argc, char *argv[]) {
Settings s(settings_file_path);
Net n;
// std::vector<std::string> ofd_updates = ofd.check_updates();
// for (const std::string &update : ofd_updates) {
// std::cout << "Downloading "
// << s.get_setting("ofds_modules_url") + update << " to "
// << get_path_relative_to_home(s.get_setting("ofds_modules_dir") +
// "/" + update)
// << std::endl;
// n.get_file(s.get_setting("ofds_modules_url") + "/" + update,
// get_path_relative_to_home(s.get_setting("ofds_modules_dir") +
// "/" + update));
// }
Parser p;
std::vector<std::string> stores_updates = p.check_updates();\
std::vector<std::string> stores_updates = p.check_updates();
for (const std::string &update : stores_updates) {
std::cout << "Downloading "
<< s.get_setting("stores_modules_url") + update << " to "