Use sc::request from libscrequest

This commit is contained in:
Bob Polis 2023-11-05 00:49:55 +00:00
parent d8e726705a
commit 9df3dd7d90

View File

@ -6,7 +6,7 @@
#include <fstream> #include <fstream>
#include <getopt.h> #include <getopt.h>
#include <libsclogging.hpp> #include <libsclogging.hpp>
#include "requester.hpp" #include <libscrequest.hpp>
#include "compiler.hpp" #include "compiler.hpp"
sc::logger logger {"curly", sc::loglevel::info}; sc::logger logger {"curly", sc::loglevel::info};
@ -54,7 +54,8 @@ int main(int argc, char* argv[]) {
// here when no file args // here when no file args
std::string base_url {"https://bobpolis.com/krul/"}; std::string base_url {"https://bobpolis.com/krul/"};
std::string next_url {"start.txt"}; std::string next_url {"start.txt"};
requester req; sc::requester req;
req.logger(&logger);
while (!done) { while (!done) {
std::istringstream in {req.get(base_url + next_url)}; std::istringstream in {req.get(base_url + next_url)};
next_url = proc.eval(in, done); next_url = proc.eval(in, done);