From 654d93130ac1ffd99b36de22edf7e1068f91c929 Mon Sep 17 00:00:00 2001 From: YusufovYB Date: Sat, 3 Jun 2023 18:32:45 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=20cURL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chtoto.cbp | 5 +++++ main.cpp | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/chtoto.cbp b/chtoto.cbp index e39e670..8165589 100644 --- a/chtoto.cbp +++ b/chtoto.cbp @@ -31,7 +31,12 @@ + + + + + diff --git a/main.cpp b/main.cpp index aec7f45..cce3745 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include "histogram.h" #include "text.h" +#include using namespace std; struct Input { @@ -30,7 +31,19 @@ Input input_data(istream& in, bool prompt) return inn; } -int main() { +int main(int argc, char*argv[]) { + curl_global_init(CURL_GLOBAL_ALL); + if (argc > 1) + { + CURL *curl = curl_easy_init(); + if(curl) { + CURLcode res; + curl_easy_setopt(curl, CURLOPT_URL, argv[1]); + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + } + } + auto in = input_data(cin, true); auto bins = make_histogram(in.numbers, in.bin_count); show_histogram_svg(bins);