summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDavid Blajda <blajda@hotmail.com>2018-12-27 02:29:37 +0000
committerDavid Blajda <blajda@hotmail.com>2018-12-27 02:29:37 +0000
commit2e08d0c8abbfb9f989c61acb4f6c580719a65b42 (patch)
tree854c916b2ac6370c58308c70fc094978a23cbc67 /src/bin
parentadcc342c9c1674ce88ebaf7f9359bde9665ca3f8 (diff)
:Allow iteration over endpoints that provide pagination
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/main.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs
index 81f07ff..982dc9d 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -5,6 +5,7 @@ extern crate tokio;
extern crate twitch_api;
use futures::future::Future;
+use futures::Stream;
use std::env;
use twitch_api::HelixClient;
@@ -35,6 +36,18 @@ fn main() {
()
});
+ let videos = authed_client
+ .videos()
+ .by_user("67955580")
+ .take(10)
+ .for_each(|collection| {
+ println!("{:?}", collection);
+ Ok(())
+ })
+ .map(|_| ())
+ .map_err(|err| {println!("{:?}", err); ()});
+
+
/*
let clip2 = client.kraken
.clip(&"EnergeticApatheticTarsierThisIsSparta")
@@ -51,6 +64,7 @@ fn main() {
*/
//std::mem::drop(authed_client);
tokio::run(
+ /*
clip.join(clip2)
.and_then(|(c1, c2)| {
println!("{:?} {:?}", c1, c2);
@@ -67,5 +81,7 @@ fn main() {
})
.map(|_| ())
.map_err(|_| ())
+ */
+ videos
);
}