Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
app-script for taking a twilio MMS post from a 3G game camera to google drive
/* Connect your 3g game camera to google drive
* 1) buy camera:
* 2) Configure it to point to your twilio number
* 3) Deploy google app script below as a public webapp
* 4) Configure twilio to point to your app script
function doGet() {
return ContentService.createTextOutput("");
function doPost(e) {
var drop = "camp camera";
var folder, folders = DriveApp.getFoldersByName(drop);
/* Find the folder, create if the folder does not exist */
if (folders.hasNext()) {
folder =;
} else {
folder = DriveApp.createFolder(drop);
/* Twilio sends the URL, download it */
/* */
var blob = UrlFetchApp.fetch(e.parameters.MediaUrl0).getAs("image/jpeg");
var file = folder.createFile(blob);
return ContentService.createTextOutput("");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment