There's a local “classic rock” station KFOX, usually on during a commute. I wondered how repetitive it actually was and (ab)used their "Now Playing" website widget to track songs/ads/promos.
-
There's a local “classic rock” station KFOX, usually on during a commute. I wondered how repetitive it actually was and (ab)used their "Now Playing" website widget to track songs/ads/promos.
- Backend data is a JSON blob (1st pic)
- Add a small shell script (2nd pic), run for 2 weeks
- Top songs in the 3rd pic
- Unique ones over 2 wk:$ jq -c 'select(.type=="Song")|[.desc,.title]' .history|sort|uniq -c|wc -l
372- Length of the tracks (see 4th image): 27h!
#radio #jq #shell #bash #scripting
-
Oh, and the top and unique artists in 2w
$ jq -c 'select(.type=="Song")|[.desc]' .history | sort | uniq -c | sort -nr | head -n10
193 ["Queen"]
178 ["Led Zeppelin"]
157 ["Aerosmith"]
151 ["AC/DC"]
143 ["Journey"]
115 ["Foreigner"]
114 ["Pink Floyd"]
106 ["Van Halen"]
103 ["Tom Petty"]
98 ["Boston"]$ jq -c 'select(.type=="Song")|[.desc]' .history | sort | uniq | wc -l
120 -
@jochie Someday someone is going to snap. Just snap, I tell you, and patch sort in order to make "sort|uniq -c|sort -n" a single command line option.
But then someone else is going to argue (loudly) that it should have been done with uniq. -
@http Have you heard of @timbray's "topfew” which scratches a very similar itch?
https://www.tbray.org/ongoing/When/202x/2020/05/18/TopFew
https://www.tbray.org/ongoing/When/202x/2020/07/01/More-Topfew-Fun
My problem is that while I know about it, my muscle memory is too strong and it isn't necessarily installed in environments where my shell scripts may land, so that (muscle memory) isn't likely to change any time soon.
-
@jochie @http Best link: https://github.com/timbray/topfew
Also now in homebrew