Skip to content

Instantly share code, notes, and snippets.

View tomjaimz's full-sized avatar

Tom Spence tomjaimz

  • Stockholm
  • 16:29 (UTC +01:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tomjaimz on github.
  • I am tom_sw (https://keybase.io/tom_sw) on keybase.
  • I have a public key ASD0Mzu8Z8yUi6_csgsQBiFiayp_GmrFZc3i1pP4-rzTtAo

To claim this, I am signing this object:

@tomjaimz
tomjaimz / ICS Import.gs
Last active June 4, 2024 10:23
Google App Script code to import events from a Calendar (.ics) file into Google Sheets.
function onOpen() {
SpreadsheetApp.getUi().createAddonMenu().addItem('Upload', 'upload').addToUi();
}
function upload() {
SpreadsheetApp.getUi().showModalDialog(HtmlService.createHtmlOutput(
'<form><input type="file" name="file" onchange="var reader = new FileReader(); reader.onloadend = (e) => google.script.run.withSuccessHandler(google.script.host.close).importICS(e.target.result); reader.readAsText(this.parentNode.file.files[0]);"></form>'
), 'Select .ics file');
}
<!DOCTYPE html>
<html>
<head>
<script src="//sdk.scdn.co/spotify-player.js"></script>
</head>
<body>
<pre>Open Console</pre>
<script>
let token;
let sdkReady;