listenbrainz-rs/examples/user_listens.rs

17 lines
480 B
Rust
Raw Permalink Normal View History

2021-01-19 22:45:43 +00:00
use listenbrainz::raw::Client;
2021-01-14 01:49:41 +00:00
fn main() {
let user_name = std::env::args().nth(1).expect("No username provided");
let client = Client::new();
2021-01-14 01:49:41 +00:00
let result = client.user_listen_count(&user_name);
println!("Listen count: {:#?}", result);
let result = client.user_playing_now(&user_name);
println!("Playing now: {:#?}", result);
2021-01-14 02:29:21 +00:00
let result = client.user_listens(&user_name, None, None, Some(5), None);
2021-01-14 01:49:41 +00:00
println!("Recent listens: {:#?}", result);
}