Created
October 13, 2023 22:47
-
-
Save l3gacyb3ta/178b7369b4c21030cc1e4c615f972ca0 to your computer and use it in GitHub Desktop.
Nushell Radio Free Fedi Status
This file contains 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
#!/opt/homebrew/bin/nu | |
# Get info from Radio Free Fedi! | |
let html = (curl -s 'https://radiofreefedi.net/np.php') | |
let track_info = (echo $html | htmlq --text ".leftR .trackT" | split column " - " | rename artist track) | |
let artist_url = ($html | htmlq --attribute href '.leftR a' | lines | get 1 | str trim) | |
let track = $"($track_info | get track | get 0) - ($track_info | get artist | get 0)" | |
echo (echo "RADIO FREE FEDI" | fill -a center -w (echo $track | str length)) | |
echo $track | |
echo ((echo $artist_url) | fill -a r -w (echo $track | str length)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment