This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This fetches the summary for a user for a specific date: YYYYMMDD | |
r = requests.get( | |
'https://api.moves-app.com/api/1.1/user/activities/daily/'+ date +'?access_token=USERs_ACCESS_TOKEN') | |
js = json.load(r) | |
summary = js[0]['summary'] | |
if summary is not None: | |
for x in range(len(summary)): | |
activity = summary[x]['activity'] | |
if str(activity) == 'walking': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1"> | |
<div data-id="steps" data-view="Number" data-title="Steps Taken" data-moreinfo="In steps" > | |
</div> | |
</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "current": 100 }' http://localhost:3030/widgets/WIDGET_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -d '{ "auth_token":"YOUR_AUTH_TOKEN", "points": [{ "x":"1", "y":"9" }, {"x":"2","y":"14"}] }' http://localhost:3030/widgets/WIDGET_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": 100 }' http://localhost:3030/widgets/WIDGET_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/auth') | |
def auth(): | |
# here we want to get the ?code=<authorizationcode> | |
code = request.args.get('code') | |
if code == None: | |
return "Error" | |
else: | |
#exchange authorization code for an access token, | |
#make a POST request to the access token url endpoint: | |
r=requests.post("https://api.moves-app.com/oauth/v1/access_token?grant_type=authorization_code&code="+str(code)+"&client_id=CLIENT_ID&client_secret=CLIENT_SECRET") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true | |
do | |
output = $(python /root/python/movesParse.py) | |
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", $output }' http://localhost:3030/widgets/steps | |
echo "sleeping..." | |
sleep 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RANGE_HR=200 | |
RANGE_T=32 | |
RANGE_O=50 | |
SLEEP_SECONDS=2 | |
while [ true ] | |
do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec trace_insert ((x,d) as e) t = match t with | |
| Empty -> (Node(e,Empty,Empty), H x) | |
| Node((y,d'),l,r) -> if (y=x) then (Node(e,l,r),H x) | |
else if x<y then | |
let(t',tr) = trace_insert e l in ( Node((y,d'),t',r), L(y,tr) ) | |
else | |
let(t',tr) = trace_insert e r in ( Node((y,d'),l,t'), R(y,tr) ) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec trace_insert ((x,d) as e) t = match t with | |
| Empty -> (Node(e,Empty,Empty), H x) | |
| Node((y,d'),l,r) -> if (y=x) then (Node(e,l,r),H x) | |
else if x<y then | |
let(t',tr) = trace_insert e l in ( Node((y,d'),t',r), L(y,tr) ) | |
else | |
let(t',tr) = trace_insert e r in ( Node((y,d'),l,t'), R(y,tr) ) | |