Edits history of script submission #68 for ' List Worksheets (gsheets)'

  • deno
    One script reply has been approved by the moderators
    Ap­pro­ved
    type Gsheets = {
      token: string;
    };
    export async function main(gsheets_auth: Gsheets, spreadsheetId: string) {
      const token = gsheets_auth["token"];
    
      const GET_WORKSHEET_URL = `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?&fields=sheets.properties`;
    
      const response = await fetch(GET_WORKSHEET_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
      const text = await response.json();
    
      let list = [];
      for (let i in text["sheets"]) {
        list.push({
          sheetId: text["sheets"][i]["properties"]["sheetId"],
          title: text["sheets"][i]["properties"]["title"],
        });
      }
    
      return list;
    }
    

    Submitted by hugo697 371 days ago

  • deno
    type Gsheets = {
      token: string;
    };
    export async function main(gsheets_auth: Gsheets, spreadsheetId: string) {
      const token = gsheets_auth["token"];
    
      const GET_WORKSHEET_URL = `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?&fields=sheets.properties`;
    
      const response = await fetch(GET_WORKSHEET_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
      const text = await response.json();
    
      let list = [];
      for (let i in text["sheets"]) {
        list.push({
          sheetId: text["sheets"][i]["properties"]["sheetId"],
          title: text["sheets"][i]["properties"]["title"],
        });
      }
    
      return list;
    }
    

    Submitted by admin 1003 days ago

  • deno
    
    type Gsheets = {
      token: string;
    };
    export async function main(gsheets_auth: Gsheets,
        spreadsheetId: string,
    ) {
    
        const token = gsheets_auth["token"];
    
        const GET_WORKSHEET_URL =
            `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?&fields=sheets.properties`;
    
    
        const response = await fetch(GET_WORKSHEET_URL, {
            method: "GET",
            headers: {
                Authorization: "Bearer " + token,
                "Content-Type": "application/json",
            },
        });
        const text = await response.json()
    
        let list = [];
        for (let i in text['sheets']) {
            list.push({ sheetId: text['sheets'][i]['properties']['sheetId'], title: text['sheets'][i]['properties']['title'] })
        }
    
        return list;
    }

    Submitted by admin 1006 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(gsheets_auth: wmill.Resource<"gsheets">,
        spreadsheetId: string,
    ) {
    
        const token = gsheets_auth["token"];
    
        const GET_WORKSHEET_URL =
            `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?&fields=sheets.properties`;
    
    
        const response = await fetch(GET_WORKSHEET_URL, {
            method: "GET",
            headers: {
                Authorization: "Bearer " + token,
                "Content-Type": "application/json",
            },
        });
        const text = await response.json()
    
        let list = [];
        for (let i in text['sheets']) {
            list.push({ sheetId: text['sheets'][i]['properties']['sheetId'], title: text['sheets'][i]['properties']['title'] })
        }
    
        return list;
    }

    Submitted by adam186 1135 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(gsheets_auth: wmill.Resource<"gsheets">,
        spreadsheetId: string,
    ) {
    
        const token = gsheets_auth["token"];
    
        const GET_WORKSHEET_URL =
            `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?&fields=sheets.properties`;
    
    
        const response = await fetch(GET_WORKSHEET_URL, {
            method: "GET",
            headers: {
                Authorization: "Bearer " + token,
                "Content-Type": "application/json",
            },
        });
        const text = await response.json()
    
        let list = [];
        for (let i in text['sheets']) {
            list.push({ sheetId: text['sheets'][i]['properties']['sheetId'], title: text['sheets'][i]['properties']['title'] })
        }
    
        return list;
    }

    Submitted by adam186 1170 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(gsheets_auth: wmill.Resource<"gsheets">,
        spreadsheetId: string,
    ) {
    
        const token = gsheets_auth["token"];
    
        const GET_WORKSHEET_URL =
            `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}?&fields=sheets.properties`;
    
    
        const response = await fetch(GET_WORKSHEET_URL, {
            method: "GET",
            headers: {
                Authorization: "Bearer " + token,
                "Content-Type": "application/json",
            },
        });
        const text = await response.json()
    
        let list = [];
        for (let i in text['sheets']) {
            list.push({ sheetId: text['sheets'][i]['properties']['sheetId'], title: text['sheets'][i]['properties']['title'] })
        }
    
        return list;
    }

    Submitted by rossmccrann 1385 days ago