aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/zot/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/zot/main.rs')
-rw-r--r--src/bin/zot/main.rs22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/bin/zot/main.rs b/src/bin/zot/main.rs
index 83ae916..383f25f 100644
--- a/src/bin/zot/main.rs
+++ b/src/bin/zot/main.rs
@@ -125,16 +125,22 @@ async fn main() -> Result<(), Box<(dyn std::error::Error + 'static)>> {
let s = Stream::from_json(&json)?;
for item in s.items {
if item.is_post() {
- if item.title.len() > 0 {
- println!("# {}", item.title);
+ let mut summary = item.title;
+
+ if summary.len() == 0 {
+ if item.summary.len() > 0 {
+ summary = item.summary;
+ } else {
+ summary = item.body;
+ }
}
- if item.summary.len() > 0 {
- println!("Summary: {}\n", item.summary);
- } else {
- println!("{}\n", item.body);
- }
- println!();
+ summary.truncate(64);
+
+ println!("{} {} - {}",
+ item.created.to_string(),
+ item.author.name,
+ summary);
}
}
//println!("{}", z.channel_stream().await?);