Skip to content

book000/lastfm-recently-played-readme

 
 

Repository files navigation

Last.fm Recently Played README

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

What has changed in this Fork?

It is different from JeffreyCA/lastfm-recently-played-readme in the following ways:

  • Better artwork retrieval: Fixed an problem where artwork was not displayed for some songs.
  • Docker support: It also works with Docker.
  • Self hosting: Vercel free plan has a 10-second runtime limit, which meant that SVGs were sometimes not displayed if it took a long time to retrieve artwork, etc. Self-hosting solves this.

This fork is hosted by following:

  • https://lrpr.amatama.net: Self-hosting on my server. This is recommended in terms of vercel runtime.
  • https://lastfm-recently-played-book000.vercel.app: Hosting by Vercel.

Getting Started

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

![My scrobbles](https://lrpr.amatama.net/api?user=book000)

My scrobbles

Link to Last.fm profile

[![My Last.fm](https://lrpr.amatama.net/api?user=book000)](https://www.last.fm/user/book000)

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://lrpr.amatama.net/api?user=book000&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://lrpr.amatama.net/api?user=book000&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://lrpr.amatama.net/api?user=book000&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/book000/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

About

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

Resources

License

Stars

Watchers

Forks

Languages

  • TypeScript 94.1%
  • HTML 3.1%
  • Dockerfile 1.5%
  • JavaScript 1.2%
  • Shell 0.1%