![Latest Version]

spotify-genres-rs

Analysing spotify genres in a playlist

Building a histogram of used genres

Things you need to get started: * Register a new application at Spotify's dashboard * Get the client_id and client_secret * Get the playlist's id. You can find it it its uri: spotify:playlist:37i9dQZEVXbMDoHDwVN2tF

Example code

````rust use spotifygenres::{authspotify, getgenresfor_playlist};

fn main() { let top50 = vec![ "37i9dQZEVXbMDoHDwVN2tF", // GLOBAL "37i9dQZEVXbJiZcmkrIHGU", // GERMANY "6VZ7JY80Iy1wy7GF076AMo", // NORWAY ]; let spotify = authspotify("id", "secret"); for playlist in top50 { if let Ok(res) = getgenresforplaylist(&spotify, playlist) { let str: Vec = res.iter().map(|p| format!("{}: {}", p.0, p.1)).collect(); println!("{} -> {:#?}", playlist, str); } else { eprintln!("error in analysing: {}", playlist); } } } ````