#include #include #include #include #include "readUrl.h" using namespace std; string readUrl(const string &url) { char buf[128000]; string document; string command = "wget -O /tmp/urlload.html -o /tmp/urlload.log \""; command += url; command += "\""; system(command.c_str() ); ifstream in("/tmp/urlload.html"); if (!in) return ""; while (!in.eof() ) { in.getline(buf,128000-1); document += buf; document += "\n"; } in.close(); unlink("/tmp/urlload.html"); return document; }