Display datetime metadata in qp-rake1

This commit is contained in:
Olivier 'reivilibre' 2022-03-28 23:17:32 +01:00
parent ea0b08a3e1
commit 5f93b68b4e
1 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
use adblock::lists::RuleTypes; use adblock::lists::RuleTypes;
use anyhow::Context; use anyhow::Context;
use chrono::{TimeZone, Utc};
use clap::Parser; use clap::Parser;
use colour::{blue, blue_ln, cyan_ln, green_ln, red_ln, yellow_ln}; use colour::{blue, blue_ln, cyan_ln, green_ln, red_ln, yellow_ln};
use env_logger::Env; use env_logger::Env;
@ -104,6 +105,15 @@ pub async fn main() -> anyhow::Result<()> {
if !head.icon.is_empty() { if !head.icon.is_empty() {
println!("Icon: {}", head.icon); println!("Icon: {}", head.icon);
} }
match head.datetime {
None => {
println!("Datetime: Unknown");
}
Some(datetime_unix) => {
let datetime = Utc.timestamp(datetime_unix, 0);
println!("Datetime: {}", datetime.format("%Y-%m-%d %H:%M:%S"));
}
}
println!(); println!();
print_references(&page.referrer_entry.references); print_references(&page.referrer_entry.references);