Created by Jai-Chaudhary Nov 2015
Download Session IDs by Opening Chrome, Logging into Empatica, Clicking All Sessions. Then, click (F12), console tab and enter following commands
var sessionIDs = []
$(".sessionID").each(function() {
sessionIDs.push($(this).text());
});
JSON.stringify(sessionIDs)
the output will be an array of session IDs you can copy paste below
sessionIDs = ["95020",...,"85874"]
len(sessionIDs)
The following block downloads the zipfile from empathica. All you may need to change is the cookie.
It created a data/<sessionID>
directory and adds csv files to it
import requests, zipfile, StringIO
cookie = {'connect': 'example1234', 'session_id': 'example12345'}
url = "https://www.empatica.com/connect/download.php"
headers = {
'cache-control': "no-cache",
'postman-token': "example1234"
}
for sessionID in sessionIDs:
querystring = {"id":sessionID}
print querystring
response = requests.request("GET", url, headers=headers, params=querystring, cookies= cookie)
fileInstance = zipfile.ZipFile(StringIO.StringIO(response.content))
fileInstance.extractall('./data/' + querystring["id"])