|
|
|
@ -1,18 +1,19 @@ |
|
|
|
|
# Mammut. A API Wrapper for the Mastodon API. |
|
|
|
|
|
|
|
|
|
### [Documentation](https://docs.rs/mammut/) |
|
|
|
|
## [Documentation](https://docs.rs/mammut/) |
|
|
|
|
|
|
|
|
|
A wrapper around the [API](https://github.com/tootsuite/mastodon/blob/master/docs/Using-the-API/API.md#tag) for [Mastodon](https://mastodon.social/) |
|
|
|
|
|
|
|
|
|
```rust |
|
|
|
|
# extern crate mammut; |
|
|
|
|
# fn main() { |
|
|
|
|
# try().unwrap(); |
|
|
|
|
# } |
|
|
|
|
# fn try() -> mammut::Result<()> { |
|
|
|
|
extern crate mammut; |
|
|
|
|
use mammut::Registration; |
|
|
|
|
use mammut::apps::{AppBuilder, Scope}; |
|
|
|
|
|
|
|
|
|
fn main() { |
|
|
|
|
run().unwrap(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fn run() -> mammut::Result<()> { |
|
|
|
|
let app = AppBuilder { |
|
|
|
|
client_name: "mammut_test", |
|
|
|
|
redirect_uris: "urn:ietf:wg:oauth:2.0:oob", |
|
|
|
@ -29,6 +30,6 @@ let code = String::from("RETURNED_FROM_BROWSER"); |
|
|
|
|
let mastodon = registration.create_access_token(code)?; |
|
|
|
|
|
|
|
|
|
println!("{:?}", mastodon.get_home_timeline()?); |
|
|
|
|
# Ok(()) |
|
|
|
|
# } |
|
|
|
|
Ok(()) |
|
|
|
|
} |
|
|
|
|
``` |
|
|
|
|