Update libtidy and curlcpp.
This commit is contained in:
parent
44992458ac
commit
4f85fa01a9
4 changed files with 14 additions and 10 deletions
|
@ -38,7 +38,7 @@ add_executable(${PROJECT_NAME}
|
|||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
lib-tidy
|
||||
tidy-share
|
||||
${PUGIXML_LIBRARIES}
|
||||
curlcpp
|
||||
)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 05bad3db527ee3c76730d42104ddaaa8a6376a3f
|
||||
Subproject commit 194fdb0ced92a993a60cd0810610845a12023e82
|
2
lib/tidy
2
lib/tidy
|
@ -1 +1 @@
|
|||
Subproject commit 2e383c602957245ff4bc566d1760b525924234cb
|
||||
Subproject commit fa43957b6d2afd62c12ab507794f9053ea08557b
|
|
@ -2,7 +2,7 @@
|
|||
#include "duckscraperConfig.h"
|
||||
#include <ciso646>
|
||||
#include <tidy.h>
|
||||
#include <buffio.h>
|
||||
#include <tidybuffio.h>
|
||||
#include <sstream>
|
||||
#include <curl_easy.h>
|
||||
#include <cstring>
|
||||
|
@ -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<CURLoption, std::string>(CURLOPT_URL, parSource));
|
||||
curl_writer wr(oss);
|
||||
curl_easy easy(wr);
|
||||
easy.add(curl_pair<CURLoption, std::string>(CURLOPT_URL, parSource));
|
||||
if (isHttps(parSource)) {
|
||||
easy.add(curl::curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYPEER, parSslVerifyPeer));
|
||||
easy.add(curl::curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYHOST, parSslVerifyHost));
|
||||
easy.add(curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYPEER, parSslVerifyPeer));
|
||||
easy.add(curl_pair<CURLoption, bool>(CURLOPT_SSL_VERIFYHOST, parSslVerifyHost));
|
||||
}
|
||||
easy.add(curl::curl_pair<CURLoption, std::string>(CURLOPT_USERAGENT, parUserAgent));
|
||||
easy.add(curl::curl_pair<CURLoption, long>(CURLOPT_FOLLOWLOCATION, 1L));
|
||||
easy.add(curl_pair<CURLoption, std::string>(CURLOPT_USERAGENT, parUserAgent));
|
||||
easy.add(curl_pair<CURLoption, long>(CURLOPT_FOLLOWLOCATION, 1L));
|
||||
|
||||
//try {
|
||||
easy.perform();
|
||||
|
|
Loading…
Reference in a new issue