diff --git a/src/html_pool.cpp b/src/html_pool.cpp index add1ec2..756222a 100644 --- a/src/html_pool.cpp +++ b/src/html_pool.cpp @@ -18,9 +18,11 @@ #include "html_pool.hpp" #include "htmlretrieve.hpp" +#include "read_all.hpp" #include #include #include +#include namespace duck { HtmlPool::HtmlPool (std::string&& agent_name) : @@ -29,9 +31,17 @@ namespace duck { } auto HtmlPool::OnResourceLoad (ResourceObjectParameterType parRes) -> ResourceType* { - auto html = std::make_unique( - fetch_html(parRes, m_agent, false, false) - ); + std::unique_ptr html; + + if (parRes == "-") { + html = std::make_unique(read_all(std::cin)); + } + else { + html = std::make_unique( + fetch_html(parRes, m_agent, false, false) + ); + } + *html = duck::clean_html(std::move(*html)); return html.release(); }