- commit
- 6e6fbf9
- parent
- e9a9bb5
- author
- xxwhirlpool
- date
- 2026-04-09 17:09:24 -0400 EDT
add more radio stations, add ryan's ics script
2 files changed,
+62,
-3
+9,
-3
1@@ -13,13 +13,16 @@ declare -A stations=(
2 ["indiebeat-bonkwave"]="https://azura.theindiebeat.fm/listen/not_what_i_call_radio_bonk_wave/radio.mp3"
3 ["dadradio"]="http://stacey-campbell.com:8001/dadradio.mp3"
4 ["vintageobscura"]="https://radio.vintageobscura.net/stream"
5+ ["hbr1-tranceponder"]="https://www.hbr1.com/playlist/trance.ogg.m3u" # full-on/psychedelic
6+ ["hbr1-tronic"]="https://www.hbr1.com/playlist/tronic.ogg.m3u" # minimal/tech
7+ ["hbr1-dream"]="https://www.hbr1.com/playlist/ambient.ogg.m3u" # chillout
8 )
9
10 # little header text graphic to show before playback
11
12 gum_echo() {
13- top=$(gum style --bold --foreground "#a6d189" --border none --width 20 --margin "1 0" --align center "♥ NOW PLAYING ♥")
14- bottom=$(gum style --foreground "#f4b8e4" --border none --width 20 --margin "1 0" --align center "$@")
15+ top=$(gum style --bold --foreground "#a6d189" --border none --width 50 --margin "1 0" --align center "♥ NOW PLAYING ♥")
16+ bottom=$(gum style --foreground "#f4b8e4" --border none --width 50 --margin "1 0" --align center "$@")
17
18 joingum=$(gum join --vertical --align center "$top" "$bottom")
19 all=$(gum style --border-foreground "#99d1db" --border double --width 50 --padding "0 0" --align center "$joingum")
20@@ -30,7 +33,7 @@ gum_echo() {
21 # run the script
22
23 choice() {
24- choose=$(gum choose --header "radio stations" "kexp" "nts1" "nts2" "dadradio" "indiebeat-pop" "indiebeat-rock" "indiebeat-jazz" "vintageobscura")
25+ choose=$(gum choose --height 20 --header "radio stations" "kexp" "nts1" "nts2" "dadradio" "indiebeat-pop" "indiebeat-rock" "indiebeat-jazz" "vintageobscura" "hbr1-tranceponder" "hbr1-tronic" "hbr1-dream")
26 case "$choose" in
27 kexp) gum_echo "KEXP" && mpv "${stations['KEXP']}";;
28 nts1) gum_echo "NTS1" && mpv "${stations['NTS1']}";;
29@@ -42,6 +45,9 @@ choice() {
30 indiebeat-electronic) gum_echo "indiebeat - electronic" && mpv "${stations['indiebeat-electronic']}";;
31 indiebeat-bonkwave) gum_echo "indiebeat - bonkwave" && mpv "${stations['indiebeat-bonkwave']}";;
32 vintageobscura) gum_echo "vintage obscura" && mpv "${stations['vintageobscura']}";;
33+ hbr1-tranceponder) gum_echo "HBR1 I.D.M. tranceponder" && mpv "${stations['hbr1-tranceponder']}";;
34+ hbr1-tronic) gum_echo "HBR1 tronic lounge" && mpv "${stations['hbr1-tronic']}";;
35+ hbr1-dream) gum_echo "HBR1 dream factory" && mpv "${stations['hbr1-dream']}"
36 esac
37 }
38
+53,
-0
1@@ -0,0 +1,53 @@
2+#!/usr/bin/env ruby
3+#
4+# written by ryan of miyaku media
5+# https://miyaku.media/
6+
7+require 'erb'
8+require 'securerandom'
9+require 'mediainfo'
10+
11+def print_usage_and_exit
12+ $stderr.puts "usage:\n ./schedulebot.rb 20251207T201500 'title1' title1.mp4 'title2' title2.mp4 [...]"
13+ exit 1
14+end
15+
16+debug = false
17+url = 'https://miru.miyaku.media'
18+
19+if ARGV.empty?
20+ print_usage_and_exit
21+end
22+
23+arguments = ARGV.dup
24+start_time = arguments.shift
25+if arguments.empty? || arguments.length.odd?
26+ print_usage_and_exit
27+end
28+
29+$stderr.puts "Got start time: #{start_time}" if debug
30+current_time = Time.strptime(start_time, "%Y%m%dT%H%M%S")
31+$stderr.puts "Reparsed: #{current_time.strftime("%Y%m%dT%H%M%S")}" if debug
32+until arguments.empty? do
33+ title = arguments.shift
34+ filename = arguments.shift
35+ $stderr.puts "Generating block for #{title} from #{filename}" if debug
36+ media_info = MediaInfo.from(filename)
37+ duration = media_info.video.duration
38+ $stderr.puts "#{duration / 1000} seconds" if debug
39+ event = ERB.new(<<-EVENTBLOCK).result(binding)
40+BEGIN:VEVENT
41+UID:<%= SecureRandom.uuid.upcase %>
42+DTSTAMP:<%= Time.now.utc.strftime('%Y%m%dT%H%M%SZ') %>
43+DTSTART;TZID=America/New_York:<%= current_time.strftime("%Y%m%dT%H%M%S") %>
44+DURATION:P0DT<%= Time.at(duration / 1000).utc.strftime("%HH%MM%SS") %>
45+SUMMARY:<%= title %>
46+DESCRIPTION:Livestream at: <%= url %>
47+URL:<%= url %>
48+END:VEVENT
49+EVENTBLOCK
50+
51+ puts event
52+
53+ current_time += (duration / 1000)
54+end