Giter Club home page Giter Club logo

basis-data-export's People

Contributors

btroia avatar christofferholmstedt avatar fohlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

basis-data-export's Issues

Parse Error

Hey,

I really love this tool, but was welcomed with this message when I ran 'php basisdataexport.php' running the latest version of OS X 10.9 Mavericks.

Parse error: parse error, expecting `":: (T_PAAMAYIM_NEKUDOTAYIM)"' in /Users/angelceballos/Documents/Development/basis-export-tool/basisdataexport.php on line 93

Timestamp field is blank

Thanks for this great work!
After getting the certs in place, I was able to run the scripts and download the data successfully. However, my timestamp column is blank. Did anyone else notice this too?

Unable to use Method 2 - Via command-line arguments

Interactive mode works fine, but when I use method 2 with the same credentials and date, I receive the following error:

Caught exception: ERROR: Unable to login! Check your username and password.
Caught exception: ERROR: Unable to login! Check your username and password.
Caught exception: ERROR: Unable to login! Check your username and password.

I'm using the following command:

php basisdataexport.php [email protected] -p*********** -d2015-03-01 -fjson

Blank Data File

Hi,

First off, thanks for doing this! Much appreciated. I hope I can contribute something.

I downloaded this yesterday and had an error with the digital certificate where it would give me an ERROR: cURL error - SSL certificate problem: self signed certificate in certificate chain.

I fixed that by downloading CA certs to check against and adding a few lines to the CURL_SETOPT_ARRAY starting on line 68 in BasisExport.class.php

CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_CAINFO => 'CABundle.crt',

Then, I didn't get the error. However, instead of downloading data, I just get the header row in CSV, HTML, With JSON I get ERROR: could not save data to file and a 0KB data file. Any idea what is going on?

-etavares

Login problems

I've uploaded the files to my webserver since I don't have a localhost running on this machine and am not well-versed in terminal usage. When I go to

http://www.mayodev.com/Basis/basisdataexport.php?date=2014-05-[01-31]

I get the following error:

Caught exception: ERROR: Unable to login! Check your username and password.

I have it configured to ask for username and password each time, but it goes straight here without asking. I also tried it with the username and password hard coded into the php file, but got the same result.

As a note, I did have to add the following line to the class file to avoid an SSL error (see below):
CURLOPT_SSL_VERIFYPEER => false,

No idea if that is part of the problem or not.

My Basis is the Carbon Steel edition
Chrome Browser (latest)

Any help is appreciated!

Caught exception: ERROR: cURL error - SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

preg_match error

Heey,

Thank you for creating this tool. I am trying to download my data but this errors keeps popping up:
Warning: preg_match() expects parameter 2 to be string, resource given in C:\xampp\htdocs\xampp\BasisExport.class.php on line 88
Caught exception: ERROR: Unable to login! Check your username and password.

I did check my username and password and they are correct. It seems the $result parameter is not a string? Is there anything I can do solve this problem?

Thanks,

Jorrit

no data in exported files

Thanks for writing this code!

I have successfully used this script a few months ago. I'm running it again now, and all the exported data files are empty; the html and csv files are blank, and the json file just says:

{"error_description": ["start", "end"], "description": ["start", "end"], "error": "missing_param"}

I double-checked everything, and I am using a valid login, and there is data on the Basis website for the dates I'm trying. Could it be that Basis updated the website and this no longer works? Or can you give me any ideas on how to debug this?

Thanks!

Outstanding

This is fantastic. Since the raw data is pretty much the main thing I'm looking for in a wearable, I might buy the Basis B1 because of this script. My only question is whether you think it will be reasonable for someone like me (who knows very little about programming) to execute it. It looks like I can either copy/paste your code into a Linux client on a virtual machine or put it somewhere my browser can access (which I assume includes somewhere locally) and do it through that route. Does that sound right? If so, I think I can handle that. Is there anything else I should know?
Thanks!!

broken authentication as of 2014.01.08 pls help

Around 1/8 or so, the basis website seems to require some sort of authentication.

The $basis_userid seems the same when fished out using Chrome's inspect element, but the php script can no longer pull, it gets a 401 access denied.

/opt/local/bin/lynx --dump 'http://127.0.0.1/~raydawg/basis-data-export/basisdataexport.php'
Warning:
file_get_contents(https://app.mybasis.com/api/v1/chart/52a659b775ec5351
23c68041.json?summary=true&interval=60&units=s&start_date=2014-01-12&st
art_offset=0&end_offset=0&heartrate=true&steps=true&calories=true&gsr=t
rue&skin_temp=true&air_temp=true&bodystates=true)
[[1]function.file-get-contents]: failed to open stream: HTTP request
failed! HTTP/1.1 401 Unauthorized in
/Users/raydawg/Sites/basis-data-export/basisdataexport.php on
line 74
...

74 if(!$basisdata = file_get_contents($dataurl)) {
75 if ($debug) {
76 echo 'Error retrieving data: ' . $dataurl;
77 }
78 } else {

I also had to add these since the PHP included in Mac OS X was complaining about the time zone and memory limit, though they're unrelated:

17 ini_set('memory_limit', '-1'); // -1 here implies no limit, you can even set it to a bigger number like '192M' for 192Mb space.
18 date_default_timezone_set ('America/New_York');
19
20
21 $basis_userid = '52xxxxxxxxxxxxxxxxxxxxxx';

(actual ID replaced by x's to preserve privacy)

Suggest including the following bash script for automation:

#!/bin/sh

#
now=`date +"%Y-%m-%d" -d $1`
end=`date +"%Y-%m-%d" -d $2`
while [ "$now" != "$end" ] ; 
do 
        echo "Downloading: "$now
        php basisdataexport.php -u[username] -p[password] -d$now -f[format]
        now=`date +"%Y-%m-%d" -d "$now + 1 day"`; 
done

Just a suggestion, that way it is easy to export range of dates by doing
./test.sh 2014-10-07 2014-10-09

:)

Sleep tracking data?

Any chance that you'll be able to implement the sleep tracking data to download that information?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.