Skip to content

Instantly share code, notes, and snippets.

@inkredabull
Last active May 1, 2018 01:17
Show Gist options
  • Save inkredabull/55cd4adc7d752eab5925249a0819a484 to your computer and use it in GitHub Desktop.
Save inkredabull/55cd4adc7d752eab5925249a0819a484 to your computer and use it in GitHub Desktop.
Extract from I/O Schedule for Google Calendar
// URL : https://events.google.com/io/schedule/
// provided as-is, no warranty
// copy-paste the following into console
var s = document.createElement("script");
s.type = "text/javascript";
s.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js";
$("head").append(s);
var start_date, end_date;
$('.schedule__grid>div').each(function( idx, el ) {
var j_el = $(el);
if(j_el.hasClass('schedule__grid__day')){
start_date = j_el.text().trim();
end_date = start_date;
} else {
var start_time = j_el.find('.schedule__grid__time').text().trim();
var events = j_el.find('.schedule__grid__event');
events.each(function( idx, event ) {
var subject = $(event).find('.schedule__grid__event__title').text().trim();
var place = $(event).find('.schedule__grid__event__description').text().trim();
var info = [subject, start_date, start_time, end_date, '', place];
console.log(info.join('\t'));
});
}
});
// create sheet having headers per [1]
// copy the output into a Google Sheet
// find-replace with 'VM\d+:\d+ ' to cleanup line numbers
// make End Time be Start Time + Time(1,0,0)
// download sheet as CSV
// follow directions from here for importing into your calendar [1]
// example sheet [2]
// [1] : https://support.google.com/calendar/answer/37118?hl=en
// [2] : https://docs.google.com/spreadsheets/d/1gN0xgUiReRpPHt_KiZjto7bkQEDWxb1H-pqV3x-nXkM/edit?usp=sharing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment