Created
January 22, 2020 23:24
-
-
Save noahlearner/eea2810789a00c3d2cf94efd740eab73 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//************************************************ | |
//* This script is used to pull in Scheduled Screaming frog crawls | |
//************************************************ | |
function doPost(e){ | |
importCSVFromGoogleDrive(); | |
} | |
function doGet() { | |
importCSVFromGoogleDrive(); | |
} | |
function importCSVFromGoogleDrive() { | |
/* this should be only thing needed to be updated during build process */ | |
/* replace xxxxs with the folder id. To do that browse to the drive folder where you want to store the file, and grab the id from the end of the url. | |
for URL https://drive.google.com/drive/u/1/folders/1sr09or7856RghNM67, replace the XXXXXXXXXs with 1sr09or7856RghNM67 | |
var folder = DriveApp.getFolderById('xxxxxxxxxxxxxxxxxxxxxxx'); | |
var file = folder.getFilesByName("custom_extraction_all.csv").next(); | |
var csvData = Utilities.parseCsv(file.getBlob().getDataAsString()); | |
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Crawl"); | |
sheet.clear(); | |
sheet.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment