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
var projectId = ScriptProperties.getProperty("projectId"); | |
function プロジェクトの取得() { | |
var list = BigQuery.Projects.list(); | |
Logger.log(list); | |
} |
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
function twoleggedOAuth() { | |
var action = "https://www.google.com/calendar/feeds/default/private/full?xoauth_requestor_id={user mail address}"; | |
var accessor = { consumerSecret: '{consumerSecret}' }; | |
var message = { method: 'get', action: action, parameters: {}, }; | |
OAuth.setParameter(message, 'oauth_version', '1.0'); | |
OAuth.setParameter(message, 'oauth_nonce', OAuth.nonce(32)); | |
OAuth.setParameter(message, 'oauth_timestamp', OAuth.timestamp()); | |
OAuth.setParameter(message, 'oauth_consumer_key', '{your domain}'); | |
OAuth.SignatureMethod.sign(message, accessor); |
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
function myFunction() { | |
//oauth の設定 | |
var oauth = UrlFetchApp.addOAuthService(Session.getActiveUser().getEmail()); | |
oauth.setConsumerKey("anonymous"); //ちゃんとしたのを使ったほうがいいとおもふ | |
oauth.setConsumerSecret("anonymous"); //ちゃんとしたのを使ったほうがいいとおもふ | |
oauth.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope=https%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F"); | |
oauth.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken"); | |
oauth.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken"); |
NewerOlder