Last-Spot is a Rust application that creates personalized Spotify playlists based on your Last.fm listening history. It analyzes your top artists, finds similar artists you might enjoy, and automatically creates a Spotify playlist with their top tracks you might not know! Built with the aid of CLAUDE! <3
- Analyzes your Last.fm listening history from the past 6 months
- Discovers new artists similar to your favorites
- Automatically creates a Spotify playlist
- Randomly selects recommendations for variety
- Opens the playlist in your browser when done
Before running Last-Spot, you'll need:
-
A Last.fm API account:
- Sign up at Last.fm API
- Get your API key
-
A Spotify Developer account:
- Go to Spotify Developer Dashboard
- Create a new application
- Get your Client ID and Client Secret
- Add
http://localhost:8888/callbackto your Redirect URIs in the app settings
- Clone the repository:
git clone https://github.com/yourusername/last-spot.git
cd last-spot- Create a
.envfile in the project root with your credentials:
LASTFM_API_KEY=your_lastfm_api_key
LASTFM_USERNAME=your_lastfm_username
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
SPOTIFY_USER_ID=your_spotify_username- Build the project:
cargo build --releaseRun the program:
cargo runThe application will:
- Fetch your top albums from Last.fm
- Find similar artists
- Open your browser for Spotify authorization
- Create a new private playlist
- Add discovered tracks to the playlist
- Open the playlist in your browser
-
Last.fm Analysis:
- Fetches your top albums from the last 6 months
- Identifies unique artists from these albums
-
Discovery:
- For each top artist, finds similar artists
- Gets top albums from these similar artists
- Randomly selects tracks to ensure variety from these albums
-
Spotify Integration:
- Creates a new playlist with recommended tracks
[dependencies]
tokio = { version = "1.28", features = ["full"] }
reqwest = { version = "0.11", features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
dotenv = "0.15"
base64 = "0.21"
urlencoding = "2.1"
chrono = "0.4"
rand = "0.8"
url = "2.4"