-
Notifications
You must be signed in to change notification settings - Fork 0
What's on NPR? Shortcut #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
documentation
Improvements or additions to documentation
shortcut
A Siri Shortcut! Built either by myself or another community member.
Comments
KBIA Sample Data{
"status" : true,
"nextUp" : [
{
"widget_config" : {
"customized" : false,
"custom_fields" : false,
"episode_notes" : false,
"host_allow" : false,
"host_display" : false,
"album_art" : false,
"catalog_number" : false,
"label" : false
},
"conflicts" : [
"60bb015bc919e734e2b1c059"
],
"_id" : "60bb015bc919e734e2b1c059",
"start_time" : "16:00",
"program_id" : "53876499e1c8335046a1d4cb",
"start_utc" : "Sun Jun 05 2022 16:00:00 GMT-0400 (EDT)",
"date" : "2022-06-05",
"day" : "Sun",
"conflict_edited" : 1444836534094,
"fullend" : "2022-06-05 17:00",
"end_time" : "17:00",
"program" : {
"hosts" : [
{
"name" : ""
}
],
"station_id" : "station_kbia_58",
"program_format" : "News/Information",
"program_link" : "http://www.npr.org/templates/rundowns/rundown.php?prgId=2",
"parentID" : "517059399de8e95a460001ea",
"program_id" : "53876499e1c8335046a1d4cb",
"program_desc" : "An hour of breaking news mixed with compelling analysis, insightful commentaries, interviews, and special - sometimes quirky - features.",
"ucs" : "5387648fe1c8335046a1d4b4",
"national_program_id" : "5",
"isParent" : false,
"facebook" : "",
"name" : "All Things Considered",
"twitter" : ""
},
"end_utc" : "Sun Jun 05 2022 17:00:00 GMT-0400 (EDT)",
"event_id" : "5387655079e9edc965cb75d8",
"fullstart" : "2022-06-05 16:00"
}
],
"onNow" : {
"widget_config" : {
"customized" : false,
"custom_fields" : false,
"episode_notes" : false,
"host_allow" : false,
"host_display" : false,
"album_art" : false,
"catalog_number" : false,
"label" : false
},
"_id" : "60bb015bc919e734e2b1c067",
"start_time" : "15:00",
"program_id" : "5636b8acad4228ea612923ce",
"start_utc" : "2022-06-05T19:00:00.000Z",
"date" : "2022-06-05",
"day" : "Sun",
"conflict_edited" : 1467839241304,
"end_time" : "16:00",
"program" : {
"hosts" : [
],
"station_id" : "",
"program_format" : "News/Information",
"program_link" : "",
"parentID" : null,
"program_id" : "5636b8acad4228ea612923ce",
"program_desc" : "",
"ucs" : "5387648fe1c8335046a1d4b4",
"national_program_id" : "",
"isParent" : false,
"facebook" : "",
"name" : "Reveal",
"twitter" : ""
},
"end_utc" : "2022-06-05T20:00:00.000Z",
"event_id" : "577d7309fd377abc5a585655"
},
"display_buy" : true,
"affiliate" : {
"amazon" : "kbiaorg-20",
"itunes" : "10lJXC",
"arkiv" : "kbia"
},
"settings" : {
"times" : false
},
"ucs" : {
"station" : "station_kbia_58",
"itunes_affiliate_id" : "10lJXC",
"_zoneInfo" : {
"id" : "US_Central",
"offset" : -6
},
"_id" : "5387648fe1c8335046a1d4b4",
"amazon_affiliate_id" : "kbiaorg-20",
"enable_sx_reporting" : true,
"websitelink" : "http://www.kbia.org",
"arkiv_affiliate_id" : "kbia",
"ignores_dst" : false,
"parent_station_id" : "0",
"fullname" : "KBIA",
"timezone" : "CST",
"legacy" : "58",
"name" : "kbia"
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation
shortcut
A Siri Shortcut! Built either by myself or another community member.
Social
Retrieve live NPR program information with Siri Shortcuts
For more information, please see my blog post about this shortcut.
Creating a Shortcut for Your NPR Station
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.
Finding your station's UCSID with Web Inspector
kbia.org
.)DOM
tab, use the search icon to filter forucsid
.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.
"Integration" with the Broadcasts app
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 selectEdit
. The exact value for theName
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."Integration" with Apple Music
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, ishttps://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.)"Integration" with VLC media player
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 theResources
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:
The text was updated successfully, but these errors were encountered: