diff options
Diffstat (limited to 'src/bin/zot')
-rw-r--r-- | src/bin/zot/main.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/bin/zot/main.rs b/src/bin/zot/main.rs index 63b4557..209e097 100644 --- a/src/bin/zot/main.rs +++ b/src/bin/zot/main.rs @@ -15,6 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +use zotapi::Stream; + use clap::{clap_app, crate_authors, crate_version}; use dotenv::dotenv; use std::env; @@ -115,7 +117,22 @@ async fn main() -> Result<(), Box<(dyn std::error::Error + 'static)>> { } } ("stream", Some(_)) => { - println!("{}", z.channel_stream().await?); + let s = Stream::from_json(&z.channel_stream().await?)?; + for item in s.items { + if item.is_post() { + if item.title.len() > 0 { + println!("# {}", item.title); + } + + if item.summary.len() > 0 { + println!("Summary: {}\n", item.summary); + } else { + println!("{}\n", item.body); + } + println!(); + } + } + //println!("{}", z.channel_stream().await?); } ("export", Some(_)) => { println!("{}", z.channel_export().await?); |