Web captioner, webhooks and Google Apps Script
Push data from Web Captioner to Google Sheets via webhooks built using Apps Script.
A couple months ago I'd published a few tips on building a reliable, secure & scalable architecture using apps script but it wasn't until much later that i'd actually gotten a neat little use-case to demo that 😉
Aside: thanks to Martin Hawksey for sharing the problem statement!
Context
I've always been a huge fan of being able to work with webhooks and spreadsheets - you might recall the subtle credit from here - and this post is -
- to bolster the fact that one can build / create webhooks using apps script (don't know why google's official docs don't mention using web apps as webhooks 🤷🏽♀️)
- the needle on reliability can be moved by using some of the underrated apps script features & functions
- i'm way too late on coming around to publish this post as everything that i'll be sharing now (it's 17 nov, 2020 at the time of drafting this post) is a result of something that took place in late-july, 2020
Problem statement
I was just playing with webcaptioner.com which lets you specify a webhook url. I was experimenting with adding captions to a Google Doc in realtime but Apps Script couldn't keep up dropping ~20% of the captions sent via the hook
Try reading 👆🏽 in Martin's voice and in case you don't know who that is or how they sound, give Totally Unscripted a watch!
Prior reading
- quotas and limitations of Google Apps Script
- building Web Apps using Apps Script
- Lock service 🔥
Codebase
This took roughly about 10-lines of code to design -