Skip to content

Instantly share code, notes, and snippets.

@JamieMair
Last active July 9, 2024 11:12
Show Gist options
  • Save JamieMair/8e3c6e5cf5873635ccf81296b6b8399a to your computer and use it in GitHub Desktop.
Save JamieMair/8e3c6e5cf5873635ccf81296b6b8399a to your computer and use it in GitHub Desktop.
Downloading a favourited calendar ICS for JuliaCon2023

Guide

I couldn't find a way to download only my favourited talks, so I wrote a script, found in this gist. Below are instructions of how to use it for yourself.

  1. Go to https://pretalx.com/juliacon2023/schedule/ to choose your schedule and favourite the talks you want in your calendar.
  2. Next, go to the cookies page by opening up the dev tools (usually F12). I found my favourited talks on Firefox in Storage -> Local Storage -> "juliacon2023_favs" and copied the JSON array directly in the script.
  3. Paste in the array found in the cookies to your copy of the file below.
  4. Download your ICS calendar file by clicking the down arrow next to the Version number in the same folder as the script downloaded. I called my file "schedule.ics".
  5. Run the script with your favourited list and you should get a new file called "my_schedule.ics". Check to see if the talks are the ones you want.
  6. Download the ICS to your phone / import them to your calendar app of choice.
function filter_schedule(schedule_file, favourites)
output = IOBuffer()
block_buffer = IOBuffer()
is_in_block = false
ignore_block = true
open(schedule_file, "r") do f
while !eof(f)
line = readline(f)
if is_in_block
if startswith(line, "END:VEVENT")
is_in_block = false
if !ignore_block
println(block_buffer, line)
print(output, String(take!(block_buffer)))
else
take!(block_buffer)
end
elseif any(contains(line, event_id) for event_id in favourites)
ignore_block = false
else
println(block_buffer, line)
end
else
if startswith(line, "BEGIN:VEVENT")
is_in_block = true
ignore_block = true
println(block_buffer, line)
else
println(output, line)
end
end
end
end
return String(take!(output))
end
favourited_ids = ["GTKJZL","TTAJXA"] # For example, usually much longer.
favs = Set(favourited_ids)
schedule_file = "schedule.ics"
output = filter_schedule(schedule_file, favs)
open("my_schedule.ics", "w") do f
write(f, output)
end
@KeithWM
Copy link

KeithWM commented Jun 20, 2024

Thanks, that really helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment