lastfm-recently-played-readme icon indicating copy to clipboard operation
lastfm-recently-played-readme copied to clipboard

Display your recent Last.fm scrobbles on your GitHub profile README.

Last.fm Recently Played README

Show your recent Last.fm scrobbles on your GitHub profile README. Powered by Vercel.

Check out spotify-recently-played-readme for a similar integration for Spotify.

Getting Started

Just add the following into your README and set the query parameter user to your Last.fm username.

![My scrobbles](https://lastfm-recently-played.vercel.app/api?user=JeffreyCA01)

My scrobbles

Link to Last.fm profile

[![My Last.fm](https://lastfm-recently-played.vercel.app/api?user=JeffreyCA01)](https://www.last.fm/user/JeffreyCA01)

My Last.fm

Custom track count

To a custom number of tracks, pass the query parameter count and set it to the number of tracks to display.

Default: 5
Min: 1
Max: 10

Example:

![My scrobbles](https://lastfm-recently-played.vercel.app/api?user=JeffreyCA01&count=1)

My scrobbles

Custom card width

To set a custom card width, pass the query parameter width and set it to the desired width in px.

Default: 400
Min: 300
Max: 1000

Example:

![My scrobbles](https://lastfm-recently-played.vercel.app/api?user=JeffreyCA01&width=600)

My scrobbles

Show loved tracks

Set the loved parameter to true to show a heart indicator next to your loved tracks.

Default: false

Example:

![My scrobbles](https://lastfm-recently-played.vercel.app/api?user=JeffreyCA01&loved=true)

My scrobbles

Further customization:

You can set the loved_style parameter to 1, 2, 3, or 4 to customize the indicator placement.

Default: 1

Style 1 Style 2 Style 3 Style 4

Deploying own Vercel project

Deploy with Vercel

Deploy your own Vercel project using the link above. Next, you'll need to set the API_KEY environment variable to your Last.fm API key. You'll also need to set the VERCEL_URL system environment variable in the Vercel project settings.

Running locally

  1. Clone Git repo
    $ git clone https://github.com/JeffreyCA/lastfm-recently-played-readme.git
    
  2. Install Node dependencies
    $ npm install
    
  3. Create .env file containing the following:
    API_KEY=<Last.fm API key>
    
  4. Run development server
    $ npm run dev
    

The app will be running at http://localhost:3000.

License

MIT