pkpio / fitbit-googlefit

Export Fitbit data to Google Fit. Unlike the alternatives such as fitnessyncer.com, this offers very fine intraday granularity (every minute/second data).
http://pkp.io/blog/fitbit-to-googlefit-sync/
GNU General Public License v3.0
491 stars 59 forks source link

NameError: name 'googleClient' is not defined #6

Closed perdidohate closed 8 years ago

perdidohate commented 8 years ago

Good day, in first place thanks for this piece of software.

When i launch "python3 app.py -s 2016-08-15 -e 2016-08-21"

it returns this:

` File "/home/perdido/programmi/fitbit-googlefit-master/remote.py", line 102, in CreateGoogleFitDataSource dataSourceId=self.convertor.GetDataSourceId(dataType)).execute() File "/usr/local/lib/python3.5/dist-packages/oauth2client/util.py", line 137, in positional_wrapper return wrapped(_args, *_kwargs) File "/usr/local/lib/python3.5/dist-packages/googleapiclient/http.py", line 838, in execute raise HttpError(resp, content, uri=self.uri) googleapiclient.errors.HttpError: <HttpError 404 when requesting https://www.googleapis.com/fitness/v1/users/me/dataSources/raw%3Acom.google.step_count.delta%3A676930878379%3Afitbit%3Acharge-hr%3Aio.pkp.fbit-gfit?alt=json returned "DataSourceId not found: raw:com.google.step_count.delta:676930878379:fitbit:charge-hr:io.pkp.fbit-gfit">

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "app.py", line 96, in main() File "app.py", line 52, in main remote.CreateGoogleFitDataSource(dataType) File "/home/perdido/programmi/fitbit-googlefit-master/remote.py", line 107, in CreateGoogleFitDataSource googleClient.users().dataSources().create( NameError: name 'googleClient' is not defined ` I've got the two files correctly for the auth2 api usage, but i've just setup the google fit account. i need to do something to inizialize? i've run through the setup, enable everything it asks me to enable and set up an objective, is it enough? Because it seems a call to something that not exist related to google fit... but maybe i'm wrong

Thanks

perdidohate commented 8 years ago

probably a problem with authentication. I' ll try a little harder to solve this

pkpio commented 8 years ago

@perdidohate , It was my mistake. I restructured the code a few commits ago and this part of the code was never tested from my account. Will push a fix in 5 mins.

pkpio commented 8 years ago

@perdidohate , Try now!

perdidohate commented 8 years ago

it works perfectly! Thank you very much for the quick fix

pkpio commented 8 years ago

Glad it did! Consider giving a star if you find it useful 😄