AppsScriptPulse

Sending data from a webcaptioner.com channel webhook to Google Sheets with Google Apps Script 

push data from web captioner to google sheets via webhooks built using apps script.

the problem – 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

Sourabh Choraria kindly helped me solve an issue I was having passing data from webcaptioner.com to Google Sheets. Click through to the source link for the full explanation from Sourabh, but in essence the problem was I was losing data because I wasn’t using the LockService.

In the meantime webcaptioner.com have also updated there channel webhooks so you can set a data chuck size so if you are looking to capture a transcript in Google Docs you can use the following published as a container bound web app:

// @OnlyCurrentDoc
function doPost(e) {
  const params = JSON.parse(e.postData.contents);
  DocumentApp.getActiveDocument()
    .getBody()
    .appendParagraph(Utilities.formatDate(new Date(), "GMT", "HH:mm:ss")+': ' + params.transcript);
}

Source: web captioner, webhooks and google apps script

Leave a Reply

Your email address will not be published. Required fields are marked *