stefangrund / PersonalAPI

Personal API is a full featured RESTful API which collects your social media and quantified self data.
http://personalapi.org/
10 stars 1 forks source link

Fitbit module: update previous days' steps #3

Closed stefangrund closed 10 years ago

stefangrund commented 10 years ago

Right now the module gets the previous days steps once a day and doesn't update them automatically. That's a problem when your tracker hasn't synced with Fitbit's server for a while. As a result the Personal API could be missing some steps or even days.

AndiH commented 10 years ago

For my (Python) Fitbit module I just get the last 10 days' information and overwrite any existing data. Fitbit's data is always more accurate than the local one, never worse than it.

stefangrund commented 10 years ago

I don't know why, but I didn't think of that. Good idea!

Can I assign this one to you, if you're still willing to modify the Fitbit module? (see this issue)

AndiH commented 10 years ago

I don't know if my current understanding of the PAPI is that detailed.
That said: Assign it to me. I will try! If I fail, I will come back to you and ask for some help :smiley:.

stefangrund commented 10 years ago

I've just updated the steps module. It's now able to add missing/new Fitbit data from the last 30 days. Outdated data will be updated, too.

The update process runs in two steps:

  1. update → adds all missing days
  2. update → if there are no more days missing, it updates the outdated data

Also there's a new function to perform PUT requests (@AndiH): doPutRequest() in inc/global_functions.php

AndiH commented 10 years ago

Great! Thanks!