7 |
#include <iostream> |
#include <iostream> |
8 |
#include <fstream> |
#include <fstream> |
9 |
#include <iconv.h> |
#include <iconv.h> |
10 |
|
#include <stdexcept> |
11 |
#include <time.h> |
#include <time.h> |
12 |
|
|
13 |
#include "util.h" |
#include "util.h" |
177 |
string document; |
string document; |
178 |
|
|
179 |
ostringstream command; |
ostringstream command; |
180 |
command << "wget -O " << tempfile << " -o /dev/null \"" << url << "\""; |
command << "wget -O " << tempfile << " --tries=1 --timeout=15 -o /dev/null \"" << url << "\""; |
181 |
system( command.str().c_str() ); |
int res = system( command.str().c_str() ); |
182 |
|
if (res) |
183 |
|
throw std::runtime_error("Command time out"); |
184 |
|
|
185 |
ifstream in( tempfile.c_str() ); |
ifstream in( tempfile.c_str() ); |
186 |
|
|