-
-
Save cejaramillof/e9dd7d9720fc1cc30b7c1c136722e41b to your computer and use it in GitHub Desktop.
Quick Apple Script for listening to freeCodeCamp.org's Code Radio with QuickTime Player on macOS!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Quick and simple Apple Script to listen to | |
freeCodeCamp.org's Code Radio using QuickTime Player on macOS. | |
Check out the web player here: | |
https://coderadio.freecodecamp.org | |
Josh Brown <[email protected]> | |
=============== | |
Installation | |
=============== | |
- Using Script Editor (/Applications/Utilities/Script Editor.app, save this script to wherever you'd like using the 'Script' format in the save dialog | |
- File > Export | |
- In the Export Dialog select the following: | |
- File Format: Application | |
- Options: Run Only | |
- Double click when you want to listen! | |
- Pro tip: If you use Alfred or Spotlight, you can quickly start listening to Code Radio! | |
Changelog | |
v1.0 | |
- Ability to select stream from list (no relays yet) | |
*) | |
set streamList to {"128kbps MP3", "64kbps MP3"} | |
set stream128 to "https://coderadio-admin.freecodecamp.org/radio/8010/radio.mp3" | |
set stream64 to "https://coderadio-admin.freecodecamp.org/radio/8010/low.mp3" | |
set selectedStream to ¬ | |
(choose from list streamList ¬ | |
with title ¬ | |
"freeCodeCamp.org's Code Radio" with prompt ¬ | |
"Which Stream Would You Like To Use?" default items "128kbps MP3") ¬ | |
as text | |
if (selectedStream = "128kbps MP3") then | |
set theCodeRadioUrl to stream128 | |
else | |
set theCodeRadioUrl to stream64 | |
end if | |
set timestamp to (do shell script "date +'%s'") | |
tell application "QuickTime Player" | |
open URL theCodeRadioUrl & "?" & timestamp | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment