Created
March 8, 2026 00:01
-
-
Save shift/2882d4c7d798a72f546cad37223a917c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { pkgs ? import <nixpkgs> {} }: | |
| pkgs.writeShellApplication { | |
| name = "cash-bio"; | |
| runtimeInputs = with pkgs; [ curl jq ncurses ]; | |
| text = '' | |
| # Use bold and gold for the man in black | |
| BOLD=$(tput bold) | |
| GOLD=$(tput setaf 3) | |
| RESET=$(tput sgr0) | |
| echo -e "$\{BOLD\}$\{GOLD\}JOHNNY CASH: THE EARLY YEARS (1954 - 1970)$\{RESET\}" | |
| echo "--------------------------------------------------------" | |
| # Fetching from MusicBrainz API | |
| # Artist ID for Johnny Cash: d43d12a6-91b4-4e73-903b-13c381446f5f | |
| API_URL="https://musicbrainz.org/ws/2/release?artist=d43d12a6-91b4-4e73-903b-13c381446f5f&type=album&fmt=json" | |
| curl -s "$API_URL" | jq -r '.releases | |
| | map(select((."release-events"[0].date | ./[:4] | tonumber) <= 1970)) | |
| | sort_by(."release-events"[0].date) | |
| | .[] | |
| | "[\(."release-events"[0].date[:4])] - \( .title )"' \ | |
| | uniq | |
| echo "--------------------------------------------------------" | |
| echo "Note: Includes the legendary Folsom and San Quentin live sets." | |
| ''; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment