Skip to content

imvickykumar999/Learning-Javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 

Repository files navigation

>>> Thanks to... W3Schools :


image


    function callNumbers() {

      // Call the Numbers API for random math fact
      let url = "https://api.metalpriceapi.com/v1/latest?base=USD&currencies=XAU,XAG&api_key=Dxt3fx5NcET88EGsAtvrdJ";
      let fact = UrlFetchApp.fetch(url);

      let apiResponse = JSON.parse(fact.getContentText());
      Logger.log(apiResponse.timestamp, apiResponse.rates.XAU);

      let sheet = SpreadsheetApp.getActiveSheet();
    //   sheet.getRange(1,1).setValue("timestamp");
    //   sheet.getRange(1,2).setValue("rates");

      sheet.getRange(sheet.getLastRow() + 1,1).setValue(apiResponse.timestamp);
      sheet.getRange(sheet.getLastRow() + 0,2).setValue(apiResponse.rates.XAU);

    }

Function Call trigger

image

About

JavaScript Tutorial In Hindi by CodeWithHarry

Topics

Resources

Stars

Watchers

Forks

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy