diff options
author | Paul Woolcock <paul@woolcock.us> | 2018-09-10 05:49:38 -0400 |
---|---|---|
committer | Paul Woolcock <paul@woolcock.us> | 2018-09-10 08:09:09 -0400 |
commit | 7d752a9fedffa07d1bdf5cd19483cf9dced92ed6 (patch) | |
tree | 11aa95ca2557e33fdeb5b86afc0f14825b7519e7 | |
parent | 690b029d9956cfcfe86692450d7b5ce9f0f15c19 (diff) |
Adds the `replies_count` property to Status
Closes #73
-rw-r--r-- | examples/home_timeline.rs | 24 | ||||
-rw-r--r-- | src/entities/status.rs | 2 |
2 files changed, 26 insertions, 0 deletions
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<error::Error>> { + 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<Utc>, /// An array of Emoji pub emojis: Vec<Emoji>, + /// 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. |