This project collects workout data posted by the Health Auto Export app, then serves up a subscribable calendar with the workouts. This allows the user to see their workouts on calendar clients like the iOS Calendar app or Google Calendar, which is a great way to visualize big picture progress on workouts.
Instead of seeing workouts in a list, we can see them in a calendar format:
This style of visualization helps me understand at a glance how I've been sticking to a workout program. Seeing consistent effort helps build and reinforce good habits!
git clone https://github.com/benmurrell/workouts-to-ical
cd workouts-to-ical
npm install
- Make changes in Config.ts, parameters explained there.
- Be sure to change the secret values! If you use the defaults, your data could be exposed.
npm run start
- upstart - Create /etc/init/workouts-to-ical.conf
- See config-templates/workouts-to-ical.conf for sample upstart configuration
service workouts-to-ical start
service workouts-to-ical status
service workouts-to-ical stop
- Edit relevant nginx site config file (/etc/nginx/sites-available/)
- See config-templates/nginx-sites-available.conf for sample changes to proxy requests to this app
Create a REST API automation in the Health Auto Export app. Set the URL to {externalUrl}/workoutData. Add a header key/value pair that matches the {headerSecretKey} and {headerSecretVal} from src/main.ts.
- The URL should look like
https://example.com/workouts-to-ical/workoutData
Use your calendar client of choice to subscribe to the ical calendar hosted at {externalUrl}/workoutCalendar?{querystringSecretKey}={querystringSecretVal}.
- The URL should look like
https://example.com/workouts-to-ical/workoutCalendar?secret=some-secret-value
Different calendar clients follow different caching policies - the Google Calendar client only pulls from the subscribed calendar about once per 24 hours. The iOS calendar client pulls more frequently. This means that there will be some delay between when your device uploads workout data to the service and when it is shown on the calendar.
This was built and tested against version 8.1.2 of Health Auto Export.