17 #ifndef REMWHAREAD_URI_HPP 18 #define REMWHAREAD_URI_HPP 39 bool successful =
false;
45 explicit operator bool();
59 bool successful =
false;
63 explicit operator bool();
84 explicit URI(
string uri);
87 URI(
const URI &other) =
default;
88 URI &operator=(
const URI &other) =
default;
89 URI(
URI &&other) =
default;
90 URI &operator=(
URI &&other) =
default;
183 string cut_text(
const string &text, uint16_t n_chars)
const;
187 #endif // REMWHAREAD_URI_HPP html_extract get()
Download URI and extract title, description and full text.
Definition: uri.cpp:129
URI(string uri)
Construct object and set URL.
Definition: uri.cpp:68
string unescape_html(string html) const
Convert HTML entities to UTF-8.
void set_proxy()
Set proxy server.
Definition: uri.cpp:76
string make_request(const string &uri, bool archive=false) const
Make a HTTP(S) request.
Definition: uri.cpp:154
string remove_newlines(string text) const
Replace newlines with spaces.
Definition: uri.cpp:645
string remove_html_tags(const string &html, const string &tag="") const
Remove HTML tags.
string strip_html(const string &html) const
Removes HTML tags and superflous spaces from an HTML page.
string extract_title(const string &html) const
Extract the title from an HTML page.
Definition: uri.cpp:227
The result of the call to the archive service.
Definition: uri.hpp:57
string cut_text(const string &text, uint16_t n_chars) const
Limits text to N characters, cuts at space.
Definition: uri.cpp:663
Download, archive and process an URI.
Definition: uri.hpp:73
archive_answer archive() const
Save URI in archive and return archive-URI.
string extract_description(const string &html) const
Extract the description from an HTML page.
Definition: uri.cpp:244