Skip to content

w3teal/lastfm-badge

Repository files navigation

lastfm-badge

Generate a dynamic badge for the last played song on Last.fm. Insipired from abskmj/badges-lastfm

Features

  • user.getRecentTracks (last-played)
    • sorts: none
  • user.getTopAlbums (top-album)
    • sorts: all-time, 7, 30, 90, 180, 365
  • user.getTopArtists (top-artist)
    • sorts: all-time, 7, 30, 90, 180, 365
  • user.getTopTags (top-tag)
    • sorts: all-time, 7, 30, 90, 180, 365
  • user.getTopTracks (top-track)
    • sorts: all-time, 7, 30, 90, 180, 365

Example

![](https://lastfm-badge.vercel.app/top-artist?user=ligmatv&sort=365&color=blue)
            Domain                  Type       User         Sort     Color
                                                           [Advanced]

GUI

Proudly using BeerCSS. Demo

image

Building

These are the steps to run it locally or deploy it to Vercel.

  1. Get Last.fm API key
    • You must already signed up and login to LastFM account.
    • Go to Create API account page.
    • After fill up some informations (like Contact email and Application name), click Submit.
    • Copy the value next to "API key". (The character must be 32.)

Local

  1. Clone this repository
git clone https://github.com/LIGMATV/lastfm-badge.git
cd lastfm-badge
npm install
  1. Create a new file ".env" with this content (Replace XXX... with your actual API key)
API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  1. Start in your terminal
npm start

Deploy

  1. Deploy with Vercel

Limitation

LastFM does not provide any limits for API per user, including Vercel which does not provide any limits for requests and visitors. You can also check out LastFM API TOS and Vercel Limits Overview to learn more.
I would recommend you to use your own deployed version to get a stable experience.

About

Generate a dynamic badge for the last played song on Last.fm.

Topics

Resources

License

Stars

Watchers

Forks