Rust Twitch Client is a library for the Twitch REST API written in Rust!
It uses hyper as http client and serde for the serialization and deserialization of the REST entities.
Documentation is available at: http://mmitteregger.github.io/rust-twitch-client
Until the first version of this library is released and available on crates.io the dependency has to be added using the git url.
[dependencies]
twitch-client = { git = "https://github.com/mmitteregger/rust-twitch-client.git", rev = "..." }
It is highly recommended to specify a git revision as no guarantees about API stability are made yet.
extern crate twitch_client;
use twitch_client::*;
fn main() {
let twitch_client = TwitchClient::new("<YOUR_TWITCH_CLIENT_ID>").unwrap();
let top_games = twitch_client.top_games(TopGamesParams::default()).unwrap();
println!("Total games: {}", top_games.total());
println!("---");
for game_info in top_games.top() {
println!("Game: {}, Viewers: {}", game_info.game().name(), game_info.viewers());
}
println!("---");
}
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.