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 @@ | |
| 10 | 10 | ||
| 11 | 11 | user="springpool" | |
| 12 | 12 | ||
| 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" | |
| 14 | 16 | ||
| 15 | 17 | artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"') | |
| 16 | 18 | album=$(curl -s ${URL} | jq -r '.recenttracks.track[0].album."#text"') |
+3,
-6
| ... | ... | @@ -1,12 +1,9 @@ | |
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 3 | - | # get last.fm API key | |
| 4 | - | if [ -f ~/.privatevars ]; then | |
| 5 | - | . ~/.privatevars | |
| 6 | - | fi | |
| 7 | - | ||
| 3 | + | apikey=$(pass api/lastfm) | |
| 8 | 4 | 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" | |
| 10 | 7 | ||
| 11 | 8 | artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"') | |
| 12 | 9 | album=$(curl -s ${URL} | jq -r '.recenttracks.track[0].album."#text"') |
+4,
-1
| ... | ... | @@ -1,6 +1,9 @@ | |
| 1 | 1 | #!/bin/bash | |
| 2 | 2 | ||
| 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" | |
| 4 | 7 | ||
| 5 | 8 | artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"') | |
| 6 | 9 | track=$(curl -s ${URL} | jq -r '.recenttracks.track[0].name') |