Skip to content

Instantly share code, notes, and snippets.

@l3gacyb3ta
Created October 13, 2023 22:47
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 l3gacyb3ta/178b7369b4c21030cc1e4c615f972ca0 to your computer and use it in GitHub Desktop.
Save l3gacyb3ta/178b7369b4c21030cc1e4c615f972ca0 to your computer and use it in GitHub Desktop.
Nushell Radio Free Fedi Status
#!/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