Sing

Rather than my longer music playlists, I often just sing one song to fediverse, like this. It's a slightly manual process, but I have part of it automated:

nowplaying.applescript

#!/usr/bin/osascript
tell application "Music"
    set t to current track
    set msg to (t's artist & " " & t's name)
    msg
end tell

urlencode

#!/usr/bin/env python3

import sys
import urllib.parse

for line in sys.stdin:
    line = line.rstrip()
    print(urllib.parse.quote(line)) # unquote for the urldecode script

sing

#!/bin/zsh
q=`nowplaying.applescript|urlencode`
open -a Chromium "https://duckduckgo.com/?q=!yt+$q"
open -a Chromium "https://duckduckgo.com/?q=!genius+$q"

Then I just type sing, it pops up Chromium (my garbage media browser), I pick the best YT video and paste that, grab some lyrics and paste them, I have o/ bound as ♫ in Text replacements, and add a tag.

I suspect I could automate it a bit more, pick the first result on Genius and YT, but I trust neither to be right. Apple Music would be easier, but not everyone has it. I could grab cover art and paste that and a template into my appdot.net toot box. Anyway, it's the post-Human touch that shows I care. It's amusing that I have three scripting languages to get one thing done (urlencode/urldecode scripts date back to the '90s).