any NPR fans using iOS/iPadOS devices might find this shortcut I just published handy. https://bilge.world/npr-siri-shortcuts
I took @Jack Wellborn#9736’s Automation April-winning shortcut and modified it so that it can be used with any NPR station (theoretically.)
https://bilge.world/npr-siri-shortcuts
@Jack Wellborn#9736 do you have any social links you'd like me to use to further credit you?
thank you, by the way!
This shortcut is a modification of Jack Wellborn's Automation-April-winning "What's on KUTX?." Please see my blog post for full details.
For more information, please see my blog post about this shortcut.
All I really needed to customize Jack Wellborn's original shortcut was my NPR station's "UCSID,"which, for reference, is 5387648fe1c8335046a1d4b4
. Upon installation of my What's on NPR? shortcut, you'll be prompted to specify this. Unfortunately, retrieving it via NPR's API requires special authorization, for some reason, but - since we're retrieving data from an NPR station's playback widget already configured to use the API - it's actually as easy as opening your browser's "Dev Tools" or showing on your given station's homepage. If you're unfamiliar, here's a handy guide to doing so on some popular desktop web browsers.
Honestly, though, if you're already on your iOS/iPadOS device and you're willing to install a single, free Safari Extension, I believe you'll find Web Inspector to be the single, simplest method of retrieving your station's UCSID.
kbia.org
.)DOM
tab, use the search icon to filter for ucsid
.data-stream-ucsid
field.Depending on how modern your station's website is (I think - I'm supposing, here,) you may or may not find this field. For reference, here is the HTML source of KBIA's webpage from which I drew in its entirety. If you're having trouble, please feel free to contact me however you wish, ideally with your preferred station's identifier/web url.
Broadcasts is a very popular and highly-praised universal Apple application for internet radio streaming. By default, my What's on NPR? shortcut includes an action to begin streaming a station in Broadcasts, but it requires further configuration.
In all likelihood, a search of the Broadcasts Directory for your station's four-letter identifier should yield results. Once you've added your station to your library in Broadcasts, hold its icon (or ^ Tap
) to present the context menu (shown in the screenshots embedded above) and select Edit
. The exact value for the Name
field in configuration menu that results must be supplied as the answer to the second configuration step of my What's on NPR? shortcut. If you do not wish to use Broadcasts, you need only delete or replace its single action in the shortcut's default configuration.
If you've followed along this far, you now have both values you're prompted for at installation of said shortcut, by default: your station's ucsid
and its name in the Broadcasts app. You need only continue if you'd prefer to add options for Apple Music and/or VLC.
If you'd like to have a menu option to begin streaming your NPR station in Apple Music, begin by searching within the app for your station's identifier (as shown in the screenshot embedded above.) Use the triple-dot menu's Share Station
option to copy its Apple Music URL. (WBEZ's, for example, is https://music.apple.com/us/station/npr-news-wbez-chicago/ra.872998937
.) Replace or append to the Broadcasts option with a menu option pointing to an Open URLs action containing the resulting URL. (Refer to my What's on KBIA? shortcut to see this implemented.)
The VLC media player iOS app does not yet have its own Siri Shortcuts actions, but it does have a handy URL scheme which allows one to stream or download the contents of any raw media URL. Using Web Inspector as described above, I was able to find the raw stream URL for KBIA (https://playerservices.streamtheworld.com/api/livestream-redirect/KBIAFM.mp3
) quite quickly in the Resources
tab whilst streaming live.
To add an option to my shortcut to open the stream in vlc, I would add the following value in an Open URLs action:
vlc-x-callback://x-callback-url/stream?url=https://playerservices.streamtheworld.com/api/livestream-redirect/KBIAFM.mp3