Commit 27696c8

xxwhirlpool  ·  2026-01-21 18:15:48 -0500 EST
parent a7f6257
use passtore for lastfm api key
3 files changed,  +10, -8
+3, -1
......@@ -10,7 +10,9 @@
1010
1111 user="springpool"
1212
13-URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$LASTFM_APIKEY&format=json&limit=1"
13+apikey=$(pass api/lastfm)
14+
15+URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$apikey&format=json&limit=1"
1416
1517 artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"')
1618 album=$(curl -s ${URL} | jq -r '.recenttracks.track[0].album."#text"')
+3, -6
......@@ -1,12 +1,9 @@
11 #!/bin/bash
22
3-# get last.fm API key
4-if [ -f ~/.privatevars ]; then
5- . ~/.privatevars
6-fi
7-
3+apikey=$(pass api/lastfm)
84 user="springpool"
9-URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$LASTFM_APIKEY&format=json&limit=1"
5+
6+URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$apikey&format=json&limit=1"
107
118 artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"')
129 album=$(curl -s ${URL} | jq -r '.recenttracks.track[0].album."#text"')
+4, -1
......@@ -1,6 +1,9 @@
11 #!/bin/bash
22
3-URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${USER}&api_key=${API_KEY}&format=json&limit=1"
3+USER="springpool"
4+API_KEY=$(pass api/lastfm)
5+
6+URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$USER&api_key=$API_KEY&format=json&limit=1"
47
58 artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"')
69 track=$(curl -s ${URL} | jq -r '.recenttracks.track[0].name')