diff --git a/CMakeLists.txt b/CMakeLists.txt index 12f0707..bc3be9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ add_executable(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - lib-tidy + tidy-share ${PUGIXML_LIBRARIES} curlcpp ) diff --git a/lib/curlcpp b/lib/curlcpp index 05bad3d..194fdb0 160000 --- a/lib/curlcpp +++ b/lib/curlcpp @@ -1 +1 @@ -Subproject commit 05bad3db527ee3c76730d42104ddaaa8a6376a3f +Subproject commit 194fdb0ced92a993a60cd0810610845a12023e82 diff --git a/lib/tidy b/lib/tidy index 2e383c6..fa43957 160000 --- a/lib/tidy +++ b/lib/tidy @@ -1 +1 @@ -Subproject commit 2e383c602957245ff4bc566d1760b525924234cb +Subproject commit fa43957b6d2afd62c12ab507794f9053ea08557b diff --git a/src/htmlretrieve.cpp b/src/htmlretrieve.cpp index c8982ae..ac15768 100644 --- a/src/htmlretrieve.cpp +++ b/src/htmlretrieve.cpp @@ -2,7 +2,7 @@ #include "duckscraperConfig.h" #include #include -#include +#include #include #include #include @@ -83,15 +83,19 @@ namespace duck { } //unnamed namespace std::string getCleanHtml (const std::string& parSource, const std::string& parUserAgent, bool parSslVerifyPeer, bool parSslVerifyHost) { + using curl::curl_easy; + using curl::curl_pair; + std::ostringstream oss; - curl::curl_easy easy(oss); - easy.add(curl::curl_pair(CURLOPT_URL, parSource)); + curl_writer wr(oss); + curl_easy easy(wr); + easy.add(curl_pair(CURLOPT_URL, parSource)); if (isHttps(parSource)) { - easy.add(curl::curl_pair(CURLOPT_SSL_VERIFYPEER, parSslVerifyPeer)); - easy.add(curl::curl_pair(CURLOPT_SSL_VERIFYHOST, parSslVerifyHost)); + easy.add(curl_pair(CURLOPT_SSL_VERIFYPEER, parSslVerifyPeer)); + easy.add(curl_pair(CURLOPT_SSL_VERIFYHOST, parSslVerifyHost)); } - easy.add(curl::curl_pair(CURLOPT_USERAGENT, parUserAgent)); - easy.add(curl::curl_pair(CURLOPT_FOLLOWLOCATION, 1L)); + easy.add(curl_pair(CURLOPT_USERAGENT, parUserAgent)); + easy.add(curl_pair(CURLOPT_FOLLOWLOCATION, 1L)); //try { easy.perform();