Search Shared Drives

Script gdrive Verified

by rossmccrann ยท 7/27/2022

The script

Submitted by hugo989 Typescript (fetch-only)
Verified 4 days ago
1
//native
2

3
type Gdrive = {
4
  token: string;
5
};
6
export async function main(gdrive_auth: Gdrive) {
7
  const q = "";
8
  const SEARCH_SHARED_DRIVE_URL = `https://www.googleapis.com/drive/v3/drives/?q=${q}`;
9

10
  const token = gdrive_auth["token"];
11

12
  const response = await fetch(SEARCH_SHARED_DRIVE_URL, {
13
    method: "GET",
14
    headers: {
15
      Authorization: "Bearer " + token,
16
      "Content-Type": "application/json",
17
    },
18
  });
19

20
  return await response.json();
21
}
22

Other submissions
  • Submitted by rossmccrann Deno
    Created 396 days ago
    1
    type Gdrive = {
    2
      token: string;
    3
    };
    4
    export async function main(gdrive_auth: Gdrive) {
    5
      const q = "";
    6
      const SEARCH_SHARED_DRIVE_URL = `https://www.googleapis.com/drive/v3/drives/?q=${q}`;
    7
    
    
    8
      const token = gdrive_auth["token"];
    9
    
    
    10
      const response = await fetch(SEARCH_SHARED_DRIVE_URL, {
    11
        method: "GET",
    12
        headers: {
    13
          Authorization: "Bearer " + token,
    14
          "Content-Type": "application/json",
    15
        },
    16
      });
    17
    
    
    18
      return await response.json();
    19
    }
    20