Skip to content

Instantly share code, notes, and snippets.

@jjeanjacques10
Last active March 30, 2022 21:47
Show Gist options
  • Save jjeanjacques10/a04cc56d5c758c76b1cd338360b9fd5e to your computer and use it in GitHub Desktop.
Save jjeanjacques10/a04cc56d5c758c76b1cd338360b9fd5e to your computer and use it in GitHub Desktop.
async function getNews() {
const doc = new GoogleSpreadsheet('<YOUR-SPREADSHEET-ID>')
await doc.useServiceAccountAuth(creds);
await doc.loadInfo();
const sheet = doc.sheetsByIndex[0];
const rows = await sheet.getRows();
// Get last news
return cleanText(rows[(rows.length - 1)].Message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment