This is a user script for the Templater Obsidian plugin. The script will connect to the fitbit API to fetch all your activity for a given day and format it as markdown.
If you like this script, please consider buying me a coffee.
- Download the script here.
- Put the script in your templater script directory.
- Edit the DIR variable in the script to point to a folder of your choice relative to the obsidian vault root folder (the default folder is
misc
). If this folder does not yet exist it will be created when the user script is being run for the first time. The file "fibit.json" will be created inside it. - Create a templater template with the following content:
<% tp.user.fitbit(tp.file.creation_date()) %>
- Run the templater script (by inserting the template to an existing file) to create the "fitbit.json" file. The error message is expected behavior and can be ignored.
- Go to tiim.ch/fitbit-oauth2-token/ and follow the instructions to get your fitbit authentication code.
- Edit the file "fibit.json" with a text editor and replace its content with the JSON document given in the step above.
- Run the templater script again, the file "fitbit.json" will be updated and your activities of the day will be inserted to the note.
🕰 Start Time:: 16:40 🤸♂️ Sport:: Fitness 📏 Time:: 37 ⏱️ Distance:: 💓 Heartrate:: 110 ✨ Motivation::
<enter the fitness plan here>