Skip to content

Instantly share code, notes, and snippets.

@racecarparts
Last active May 17, 2016 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save racecarparts/c3c7e2db34d290cf1ef1c9724ca17e48 to your computer and use it in GitHub Desktop.
Save racecarparts/c3c7e2db34d290cf1ef1c9724ca17e48 to your computer and use it in GitHub Desktop.
How to make Google Hangout links work with regular calendar apps.

How to get Google Hangout links to work in any calendar app.

  1. Open up a new Google Apps Script
    https://script.google.com/intro
  2. Paste in the HangoutLinkMaker.gs from this gist.
  3. In Apps Script Editor menu: Choose "Resources" --> "Advanced Google Services"
  4. Set "Calendar API" to "on"
  5. To Enable Calendar in the Google Developers Console:
    https://console.developers.google.com/project/321834295443/apiui/api
  6. Click on the "Calendar API" link
  7. Click on "Enable"
  8. Open your Google Calendar --> "My calendars" --> Click on the drop-down arrow --> Choose "Calendar settings"
  9. Right click on your calendar name
  10. Look for "Calendar Address" --> Copy value after "Calendar ID:"
  11. Paste value of the Calendar ID over "YOUR CALENDAR ID" into the script in the Google Apps Script Editor.
  12. In Apps Script Editor menu: Choose "Resources" --> "Current project's triggers"
  13. Add a trigger to run every hour (or whatever you want).
  14. Run the script (you'll probably have to grant authorization the first time).

That's it. Now it will run every hour, and put in your Google Hangout links in the description of your events.

yay.

function moveHangoutLinks() {
var calendarId = 'YOUR CALENDAR ID';
var now = new Date();
var events = Calendar.Events.list(calendarId, {
timeMin: now.toISOString(),
singleEvents: true,
orderBy: 'startTime',
maxResults: 10
});
if (events.items && events.items.length > 0) {
for (var i = 0; i < events.items.length; i++) {
var event = events.items[i];
var d = event.description;
if (!d)
d = '';
if (event.hangoutLink && (d.indexOf('Hangout: ')== -1)){
//Logger.log (event.summary + ' - ' + event.hangoutLink + ' - ' + event.description);
event.description = 'Hangout: ' + event.hangoutLink + '\n\n' + d;
Calendar.Events.update(event, calendarId, event.id);
}
}
} else {
Logger.log('No events found.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment