blob: c995d4d29ce7f7cfa5f371756b7667a55cc3709a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
extern crate twitch_api;
extern crate tokio;
extern crate dotenv;
extern crate futures;
extern crate serde;
use twitch_api::TwitchApi;
use std::env;
use futures::future::Future;
fn main() {
dotenv::dotenv().unwrap();
let mut twitch_api = TwitchApi::new(env::var("TWITCH_API").unwrap());
let mut users = twitch_api.users(vec![], vec!["shroud", "ninja"])
.and_then(|json| {
println!("{:?}", json);
Ok(json)
})
.map(|_| ())
.map_err(|_| ());
tokio::run(users);
}
|