Created
April 9, 2020 05:59
-
-
Save Adrian-Samuel/324e4ee3c6f90fc729e754a12186b84d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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