diff --git a/examples/home_timeline.rs b/examples/home_timeline.rs new file mode 100644 index 0000000..48da6f4 --- /dev/null +++ b/examples/home_timeline.rs @@ -0,0 +1,24 @@ +#![cfg_attr(not(feature = "toml"), allow(dead_code))] +#![cfg_attr(not(feature = "toml"), allow(unused_imports))] +mod register; + +use register::MastodonClient; +use std::error; + +#[cfg(feature = "toml")] +fn main() -> Result<(), Box> { + let mastodon = register::get_mastodon_data()?; + let tl = mastodon.get_home_timeline()?; + + println!("{:#?}", tl); + + Ok(()) +} + +#[cfg(not(feature = "toml"))] +fn main() { + println!( + "examples require the `toml` feature, run this command for this example:\n\ncargo run \ + --example print_your_profile --features toml\n" + ); +} diff --git a/src/entities/status.rs b/src/entities/status.rs index c2f9f6f..0f66a7f 100644 --- a/src/entities/status.rs +++ b/src/entities/status.rs @@ -30,6 +30,8 @@ pub struct Status { pub created_at: DateTime, /// An array of Emoji pub emojis: Vec, + /// The numbef or replies to this status. + pub replies_count: u64, /// The number of reblogs for the status. pub reblogs_count: u64, /// The number of favourites for the status.