Last active
November 4, 2015 17:36
-
-
Save sakadon/39177b3bf27caee54f3b to your computer and use it in GitHub Desktop.
Google Spreadsheetsに内容を追記するshell script + Google apps scripts ref: http://qiita.com/sakadon/items/e56856dd7d3c5b93cde1
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 doPost(e) { | |
var ss = SpreadsheetApp.openById("###_API_TOKEN_###"); | |
var sheet = ss.getSheetByName("シート名"); | |
//formデータを取り出して、配列に格納 | |
var array = [e.parameters.timestamp[0],e.parameters.hostname[0],e.parameters.plan[0],e.parameters.uri[0]]; | |
//一発で最終行に書込みする | |
sheet.appendRow(array); | |
} |
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
nowdata='現在時刻' | |
hostname='ホスト名' | |
plan='プラン' | |
curl -F "timestamp=${nowdate}" -F "hostname=${hostname}" -F "plan=${plan}" -F "uri=https://${hostname}/${dirname}/" https://script.google.com/macros/s/###_API_TOKEN_####/exec > /dev/null | |
echo ">> Added for Google spreadsheet" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment