From 08cec360e16615b1ae157e4926e7317d16765f7e Mon Sep 17 00:00:00 2001 From: George Abbott Date: Wed, 4 Oct 2023 20:20:57 +0100 Subject: Progress thus far --- source/html.d | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/html.d (limited to 'source/html.d') diff --git a/source/html.d b/source/html.d new file mode 100644 index 0000000..768e270 --- /dev/null +++ b/source/html.d @@ -0,0 +1,38 @@ +// Represents all functions for process the raw HTML and +// extracting information from it, transforming it, etc. +// All fns operate on strings. + +import std.algorithm : findSplitAfter, find; + + +// Given the haystack (the full HTML) search for the RSS comment +// representing that attribute. +string find_rss_comment(string attr, string haystack) +in (haystack !is null) +{ + immutable string needle = "")[0]; + return result; +} + +string find_html_title(string htmltext) +{ + // TODO: implement. + immutable string init_tag = ""; + string found = htmltext.find(init_tag); + if (found is null) + return null; + + found = found[init_tag.length .. $]; + string result = found.findSplitAfter("")[0]; + return result; +} -- cgit v1.2.1