diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/zot/main.rs | 22 | ||||
-rw-r--r-- | src/stream/actor.rs | 2 |
2 files changed, 15 insertions, 9 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?); diff --git a/src/stream/actor.rs b/src/stream/actor.rs index 4e2bbe4..3ee371d 100644 --- a/src/stream/actor.rs +++ b/src/stream/actor.rs @@ -12,7 +12,7 @@ use url::Url; #[derive(Debug, Deserialize, PartialEq)] pub struct Actor { - name: String, + pub name: String, address: Option<String>, url: Option<Url>, id: String, |