summaryrefslogtreecommitdiffstats
path: root/examples/home_timeline.rs
diff options
context:
space:
mode:
authorPaul Woolcock <paul@woolcock.us>2018-09-10 05:49:38 -0400
committerPaul Woolcock <paul@woolcock.us>2018-09-10 08:09:09 -0400
commit7d752a9fedffa07d1bdf5cd19483cf9dced92ed6 (patch)
tree11aa95ca2557e33fdeb5b86afc0f14825b7519e7 /examples/home_timeline.rs
parent690b029d9956cfcfe86692450d7b5ce9f0f15c19 (diff)
Adds the `replies_count` property to Status
Closes #73
Diffstat (limited to 'examples/home_timeline.rs')
-rw-r--r--examples/home_timeline.rs24
1 files changed, 24 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"
+ );
+}