Advertisement
Guest User

Test split

a guest
May 23rd, 2021
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function testApi(){
  2.   const url = "https://financialmodelingprep.com/api/v3/earning_call_transcript/AAPL?quarter=3&year=2020&apikey=demo"
  3.   const res = UrlFetchApp.fetch(url)
  4.   const data = JSON.parse(res.getContentText())
  5.   const split = data[0].content.split(/\n/);
  6.   const output = []
  7.  
  8.   split.forEach(line => { output.push([line])})
  9.  
  10.   SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Test').getRange(1,1,output.length,1).setValues(output)
  11.  
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement