tanaike - Google Apps Script, Gemini API, and Developer Tips

The Thinker

Directly Using Access Token by googleapis for Node.js

Gists

This sample script is for directly using the refreshed access token by googleapis for Node.js. When oauth2Client.refreshAccessToken((err, tokens) => {}); is used to retrieve the refreshed access token, the following error occurs.

DeprecationWarning: The refreshAccess Token method has been deprecated, and will be removed in the 3.0 release of goo gle-auth-library. Please use the getRequestHeaders method instead.

It is required to use getRequestHeaders(). But I couldn’t find the sample script using getRequestHeaders(). So I created this sample script. If this was useful for you, I’m glad.

Retrieving file list with folder structure under a specific folder in Google Drive

Gists

When I create applications for using Google Drive, I often retrieve a file list from a folder in the application. So far, I had created the script for retrieving a file list from a folder for each application. Recently, I thought that if there is the script for retrieving the file list with the folder tree from the folder of Google Drive as a library, it will be useful for me and other users. So I created them.

python library - getfilelistpy

Overview

This is a python library to retrieve the file list with the folder tree from the specific folder of Google Drive.

Description

When I create applications for using Google Drive, I often retrieve a file list from a folder in the application. So far, I had created the script for retrieving a file list from a folder for each application. Recently, I thought that if there is the script for retrieving the file list with the folder tree from the folder of Google Drive as a library, it will be useful for me and other users. So I created this.

node module - google-drive-getfilelist

Overview

This is a Node.js module to retrieve the file list with the folder tree from the specific folder of Google Drive.

Description

When I create applications for using Google Drive, I often retrieve a file list from a folder in the application. So far, I had created the script for retrieving a file list from a folder for each application. Recently, I thought that if there is the script for retrieving the file list with the folder tree from the folder of Google Drive as a module, it will be useful for me and other users. So I created this.

Updated: Go Library - go-getfilelist to v101

go-getfilelist was updated to v1.0.1

  • v1.0.1 (November 13, 2018)

    1. From this version, in order to retrieve files and file information, “google.golang.org/api/drive/v3” is used.
      • By this, when the values are retrieved from this library, users can use the structure of drive.File.
      • Script using this library can be seen at goodls.

You can get this from https://github.com/tanaikech/go-getfilelist

Updated ggsrun to v152

ggsrun was updated to v.1.5.2

  • v1.5.2 (November 4, 2018)
    1. About downloading folders, when files are downloaded from a folder, you can download Google Docs files with the mimeType you want. For example, when you download files from the folder, if -e txt is used, Google Docs are downloaded as the text file. When -e pdf is used, they are downloaded as the PDF file. Of course, there are mimeType which cannot be converted.
      • $ ggsrun d -f [folderName] -e txt -j
    2. About uploading files, when files are uploaded from your local PC, the files got to be able to be converted to Google Docs. For this, new option of --convertto, -c is added. For example, when a text file is uploaded, if you use -c doc, the text file is uploaded as Google Document.
      • $ ggsrun u -f [fileName] -c doc -j

You can check ggsrun at https://github.com/tanaikech/ggsrun.

Updated goodls to v110

goodls was updated to v.1.1.0

  • v1.1.0 (November 4, 2018)

    1. By using API key, files from the shared folder got to be able to be downloaded while keeping the folder structure.
      • This demonstration can be seen at Demo.
    2. By using API key, the information of shared file and folder can be also retrieved.
    3. About the option of --extension and -e, when -e ms is used, Google Docs (Document, Spreadsheet, Slides) are converted to Microsoft Docs (Word, Excel, Powerpoint), respectively.

The detail information and how to get this are https://github.com/tanaikech/goodls.