mmitteregger / rust-twitch-client

[ABANDONED] A Rust library for the Twitch REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Twitch Client Build Status

Overview

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

Installation

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.

Example

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!("---");
}

License

Licensed under either of

at your option.

About

[ABANDONED] A Rust library for the Twitch REST API

License:Apache License 2.0


Languages

Language:Rust 100.0%