This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
Obsidian/Evan Steele/Templates/fitbit-daily.md

24 lines
827 B
Markdown

---
created: <% tp.file.creation_date() %>
integration: fitbit
---
# Fitbit
<%*
titleName = "Fitbit data" + " " + tp.date.now("YYYY-MM-DD")
await tp.file.rename(titleName)
await tp.file.move("Fitness/Fitbit/"+ titleName);-%>
<%*
const results = await tp.user.script_fitbit();
json_results = JSON.parse(results);
for (i = 0; i < json_results.length; i++){
tR += " ## [" + json_results[i]['Exercise']+ "](https://www.fitbit.com/activities/exercise/" +json_results[i]['Id'] + ")\n"
tR += "- Time: " + json_results[i]['Time'] + "\n";
tR += "- Calories: " + json_results[i]['Calories'] + "\n";
for (j=0; j < json_results[i]['Levels'].length;j++){
tR += "\t - " + json_results[i]['Levels'][j]['name'] + " mins: " + json_results[i]['Levels'][j]['minutes'] + "\n";
}
tR += "\n"
}
%>