From f7be10edfc3719ea51170680e8ef3260bb941186 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sat, 5 Sep 2026 20:38:46 +0100 Subject: aggregate feeds into one --- src/channel.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/channel.rs (limited to 'src/channel.rs') diff --git a/src/channel.rs b/src/channel.rs new file mode 100644 index 0000000..f4d4941 --- /dev/null +++ b/src/channel.rs @@ -0,0 +1,34 @@ +use chrono::Utc; +use rss::Channel; + +use crate::config::ChannelConfig; + +pub fn make_new_empty_channel(config: ChannelConfig) -> Channel { + Channel { + title: config.title, + link: config.link, + description: config.description, + language: config.language, + copyright: config.copyright, + managing_editor: config.managing_editor, + webmaster: config.webmaster, + pub_date: Some(Utc::now().to_rfc2822()), + last_build_date: Some(Utc::now().to_rfc2822()), + categories: config.categories, + generator: Some(String::from("https://git.joeac.net/rss-aggregator.git")), + docs: Some(String::from("https://git.joeac.net/rss-aggregator.git/tree/README.md")), + cloud: config.cloud, + ttl: config.ttl, + image: config.image, + text_input: config.text_input, + skip_hours: config.skip_hours, + skip_days: config.skip_days, + items: Vec::new(), + extensions: config.extensions, + itunes_ext: config.itunes_ext, + dublin_core_ext: config.dublin_core_ext, + syndication_ext: config.syndication_ext, + namespaces: config.namespaces, + rating: None, + } +} -- cgit v1.2.3