Forked from stoneacheck/Stoney's dumb GAS project 2
Last active
August 29, 2015 14:20
-
-
Save irvinebroque/a6ef4625ec6a7fba5428 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 shortenUrl() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheets()[0]; | |
var longUrls = sheet.getRange("J3:J10").getValues(); | |
var writeValues = [] | |
for (var i =1 ; i <= numRows; i++) { | |
var row = [] | |
var numRows = longUrls.getNumRows(); | |
var numCols = longUrls.getNumColumns(); | |
for (var j = 1; j <= numCols; j++) { | |
var url = UrlShortener.Url.insert({ | |
longUrl: longUrls}); | |
var shortUrl = url.id; | |
row.push(shortUrl) | |
} | |
writeValues.push(row) | |
} | |
sheet.getRange("M3:M10").setValues(writeValues); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment