Glide app with Sheets and IFTTT

Okay, this should do it:

function get_wiki_info() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var language = ss.getRangeByName('WikiLanguage').getValue();
  var url = 'https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=' + language;
  
  var response = UrlFetchApp.fetch(url);
  var json = response.getContentText();
  var data = JSON.parse(json);
  var page_id = Object.keys(data.query.pages);
  var extract = data.query.pages[page_id].extract;
  
  ss.getRangeByName('WikiExtract').setValue(extract);
}

It uses two Named Ranges:

  • WikiLanguage: a single cell range where you store the language string
  • WikiExtract: a single cell range where the extract will be written to
1 Like

thank you very much.

  1. Where do i execute this in Glide?
  2. Also, how do I execute that API from Glide?

This is an Apps Script. It runs in your Google Sheet, not in Glide.
From your Google Sheet menu, choose Tools -> Script Editor.
Paste the script into there.
There are various ways to execute it… directly from the script editor, via a trigger, via a custom function, via a menu extension, etc.
If you plan to continue down this route, you might want to spend a little time looking at the documentation.

1 Like

Thank you very much. I did not know about this in Google Sheets.