Skip to content

Instantly share code, notes, and snippets.

@Adrian-Samuel
Created April 9, 2020 05:59
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 Adrian-Samuel/324e4ee3c6f90fc729e754a12186b84d to your computer and use it in GitHub Desktop.
Save Adrian-Samuel/324e4ee3c6f90fc729e754a12186b84d to your computer and use it in GitHub Desktop.
function getImages() {
const sheet = SpreadsheetApp.openById(ID);
const db = DriveApp.getFolderById(ID)
const dbFiles = db.getFiles();
while (dbFiles.hasNext()) {
const file = dbFiles.next()
const driveURL = file.getUrl()
const {
origin,
pathname
} = new URL(driveURL)
const imageID = pathname.split('/')[3]
const imageURL = `${origin}/uc/export=view&id=${imageID}`
const imageResponse = UrlFetchApp.fetch(imageURL);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment