use rspotify::{prelude::*, scopes, AuthCodeSpotify, Credentials, OAuth};
fn main() {
env_logger::init();
let creds = Credentials::from_env().unwrap();
let oauth = OAuth::from_env(scopes!("user-library-read")).unwrap();
let spotify = AuthCodeSpotify::new(creds, oauth);
let url = spotify.get_authorize_url(false).unwrap();
spotify.prompt_for_token(&url).unwrap();
let stream = spotify.current_user_saved_tracks(None);
println!("Items:");
for item in stream {
println!("* {}", item.unwrap().track.name);
}
}