diff options
author | David Blajda <blajda@hotmail.com> | 2019-05-08 15:38:37 +0000 |
---|---|---|
committer | David Blajda <blajda@hotmail.com> | 2019-05-08 15:38:37 +0000 |
commit | 98fb79b85e3cfbb547e5340b30623511daf09ef5 (patch) | |
tree | a03bd7a95c86a92eb7510409429f50433056d7ab /src/bin | |
parent | 0e09c2c06fc0b81f11d12985a4172c815233db17 (diff) |
:WIP: Move types to a different crate
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/main.rs | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs deleted file mode 100644 index a545ec1..0000000 --- a/src/bin/main.rs +++ /dev/null @@ -1,124 +0,0 @@ -extern crate dotenv; -extern crate futures; -extern crate serde; -extern crate tokio; -extern crate twitch_api; -extern crate env_logger; - -use futures::future::Future; -use std::env; -use twitch_api::HelixClient; -use twitch_api::KrakenClient; -use twitch_api::ClientConfig; -use twitch_api::client::RatelimitMap; - - -fn main() { - dotenv::dotenv().unwrap(); - env_logger::init(); - - let config = ClientConfig { - max_retrys: 0, - ratelimits: RatelimitMap::empty(), - ..ClientConfig::default() - }; - - let client_id = &env::var("TWITCH_API").unwrap(); - let helix_client = HelixClient::new_with_config(client_id, config); - let kraken_client = KrakenClient::new(client_id); - - /* - .authenticate(&env::var("TWITCH_SECRET").unwrap()) - .build(); - */ - -/* - let clip = helix_client - .clips() - .clip(&"EnergeticApatheticTarsierThisIsSparta") - .map_err(|err| { - println!("{:?}", err); - () - }); - */ - /* - - let clip2 = authed_client - .clips() - .clip(&"EnergeticApatheticTarsierThisIsSparta") - .map_err(|err| { - println!("{:?}", err); - () - }); - */ - - //use twitch_api::types::VideoId; - - /* - let videos = authed_client - .videos() - .by_user(&UserId::from_str("19571641").unwrap()) - .take(1) - .for_each(|collection| { - println!("{:?}", collection); - Ok(()) - }) - .map(|_| ()) - .map_err(|err| {println!("{:?}", err); ()}); - */ - - -/* - let clip2 = kraken_client - .clips() - .clip(&"EnergeticApatheticTarsierThisIsSparta") - .map_err(|err| { - println!("{:?}", err); - () - }); -*/ - - - let f = futures::future::ok(1).and_then(move |_| { - for i in 0..80 { - let u = helix_client - .users() - .users(&vec!(), &vec!("freakey")) - .map(|res| {println!("{:?}", res); ()}) - .map_err(|res| {println!("{:?}", res); ()}); - tokio::spawn(u); - } - Ok(()) - }); - - /* Prevents tokio from **hanging** - * since tokio::run blocks the current thread and waits for the entire runtime - * to become idle but it will never becomes idle since we keep a reference - * to a reqwest client which maintains a connection pool. - */ - //std::mem::drop(authed_client); - tokio::run( - f - /* - clip.join(clip2) - .and_then(|(c1, c2)| { - println!("{:?}", c1); - println!("__"); - println!("{:?}", c2); - Ok((c1, c2)) - }).and_then(move |_| { - helix_client - .clips() - .clip(&ClipId::new("EnergeticApatheticTarsierThisIsSparta")) - .map(|_| ()) - .map_err(|err| { - println!("{:?}", err); - () - }) - }) - .map(|_| ()) - .map_err(|_| ()) - */ - /*videos*/ - ); -} |