async function getActivities (){
  activities = [];
  const data = await requestUrl('http://192.168.254.101:5678/webhook/66a780cf-6221-483d-b876-b48cd2a6d0ec')

  const response = JSON.parse(data.text);
  for (var i = 0; i< response.length; i++){
    for (var j = 0; j < response[i]['activities'].length; j++ ){
      currentActivity = response[i]['activities'][j]
      activityLevelArray = response[i]['activities'][j]['activityLevel'] 
      activities.push(
      {
        "Id":currentActivity['logId'],
        "Exercise":currentActivity['activityName'],
        "Time": new Date(currentActivity['startTime']).toLocaleString('en-US', { hour: 'numeric', minute: 'numeric', month: 'numeric', day: 'numeric', year: 'numeric', hour12: true }),
        "Calories":currentActivity['calories'],
        "Levels":activityLevelArray
      }
      )
    }
  }
  console.log(activities);
  return JSON.stringify(activities);
}
module.exports = getActivities;
