Skip to content

Instantly share code, notes, and snippets.

@kirkegaard
Created January 16, 2020 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkegaard/c0aad2b99914bea85b3deb214c76fa90 to your computer and use it in GitHub Desktop.
Save kirkegaard/c0aad2b99914bea85b3deb214c76fa90 to your computer and use it in GitHub Desktop.
#!/bin/bash
json=$(curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getRecentTracks&api_key=$LASTFM_APIKEY&user=$LASTFM_USERNAME&format=json")
artist=$(echo $json | jq -r '.recenttracks.track[0].artist["#text"]')
song=$(echo $json | jq -r '.recenttracks.track[0].name')
echo "♫ $artist - $song"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment