diff --git a/src/main.rs b/src/main.rs index 2b4ce07..10574c5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,11 +37,10 @@ fn crawl(argument: &Argument, output: &Output) -> Result<(), Box> { let mut exist = 0; let mut index = HashSet::new(); + let channel = Channel::read_from(&get(&argument.source)?.bytes()?[..])?; + // collect feed items - for item in Channel::read_from(&get(&argument.source)?.bytes()?[..])? - .items() - .iter() - { + for item in channel.items().iter() { if argument.limit.is_some_and(|limit| total >= limit) { break; } @@ -106,6 +105,12 @@ fn crawl(argument: &Argument, output: &Output) -> Result<(), Box> { let mut index = File::create(&index_filename)?; let mut total = 0; + data.push(format!("# {}", channel.title())); + + if let Some(pub_date) = channel.pub_date() { + data.push(format!("## {pub_date}")); + } + for file in files { if argument.limit.is_some_and(|limit| total >= limit) { break;