Overview In this article, I would like to introduce how to transfer files for Google Drive under no authorization.
This has also been published here. https://github.com/tanaikech/FileTransfer
Description When we download and upload files for Google Drive, it usually has to use Drive API. In order to use Drive API, access token is required. If you want to make your friends download and upload files for your Google Drive, the authorization process is to take time.
This sample script dynamically creates nested JSON objects.
Script obj := map[string]interface{}{} for i := 1; i <= 5; i++ { value := map[string]interface{}{ fmt.Sprintf("B_key%d", i): map[string]interface{}{ "C_key": "value", }, } obj[fmt.Sprintf("A_key%d", i)] = value } Result { "A_key1": { "B_key1": { "C_key": "value" } }, "A_key2": { "B_key2": { "C_key": "value" } }, "A_key3": { "B_key3": { "C_key": "value" } }, "A_key4": { "B_key4": { "C_key": "value" } }, "A_key5": { "B_key5": { "C_key": "value" } } }
This script changes slack status using GAS. If you want to change it on time you decided, it can be achieved by installing this method as a trigger.
In order to use this, the required scope is users.profile:write.
function setSlackStatus(token, user, status_text, status_emoji) { return UrlFetchApp.fetch( 'https://slack.com/api/users.profile.set', { method: 'post', payload: { token: token, user: user, profile: JSON.stringify({status_text: status_text, status_emoji: status_emoji}) }, muteHttpExceptions: true } ).
Input JSON text.txt :
{ "values": [ [ "a1", "b1", "c1" ], [ "a2", "b2", "c2" ], [ "a3", "b3", "c3" ], [ "a4", "b4", "c4" ], [ "a5", "b5", "c5" ] ] } Windows DOS type text.txt | jq -c "." Linux Bash $ cat text.
gogauth is a CLI tool to easily retrieve access token for using APIs on Google.
I thought that if the access token can easily retrieve, it may be useful for users who can use various convenience Google APIs. So I created this. Also this can be used for testing sample script like the demo. If this will be helpful for you, I’m glad.
Today, it was updated to v2.0.1. Please check it out.