Eliminate a few unnecessary variables in RSS generator.

This commit is contained in:
tastytea 2020-10-30 17:40:56 +01:00
parent 629681b3c9
commit bfe2035907
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 11 additions and 17 deletions

View File

@ -103,15 +103,11 @@ void write_rss(ostream &out, const vector<entry_type> &entries,
tmp_description += tag;
}
tmp_description += ".";
auto title{channel.append_child("title")};
title.text() = tmp_title.c_str();
auto link{channel.append_child("link")};
link.text() = baseurl.c_str();
auto description{channel.append_child("description")};
description.text() = tmp_description.c_str();
auto lastBuildDate{channel.append_child("lastBuildDate")};
lastBuildDate.text() = time::to_string(system_clock::now(), rss_time_format)
.c_str();
channel.append_child("title").text() = tmp_title.c_str();
channel.append_child("link").text() = baseurl.c_str();
channel.append_child("description").text() = tmp_description.c_str();
channel.append_child("lastBuildDate")
.text() = time::to_string(system_clock::now(), rss_time_format).c_str();
for (const auto &entry : entries)
{
@ -132,19 +128,17 @@ void write_rss(ostream &out, const vector<entry_type> &entries,
}
auto item{channel.append_child("item")};
auto item_title{item.append_child("title")};
item_title.text() = entry.instance.c_str();
item.append_child("title").text() = entry.instance.c_str();
auto item_guid{item.append_child("guid")};
item_guid.append_attribute("isPermaLink") = "false";
item_guid.text() = format("FediBlock: {:s} {:s}", entry.report_time,
entry.instance)
.c_str();
auto item_pubDate{item.append_child("pubDate")};
item_pubDate.text() = time::to_string(entry.report_time,
rss_time_format)
.c_str();
auto item_link{item.append_child("link")};
item_link.text() = format("{:s}#{:s}", baseurl, entry.instance).c_str();
item.append_child("pubDate").text() = time::to_string(entry.report_time,
rss_time_format)
.c_str();
item.append_child("link")
.text() = format("{:s}#{:s}", baseurl, entry.instance).c_str();
string tmp_item_description{format("<p>{:s}</p>"
"<p><strong>Tags:</strong> ",