Skip to content

Instantly share code, notes, and snippets.

#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':
<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>
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "current": 100 }' http://localhost:3030/widgets/WIDGET_ID
curl -d '{ "auth_token":"YOUR_AUTH_TOKEN", "points": [{ "x":"1", "y":"9" }, {"x":"2","y":"14"}] }' http://localhost:3030/widgets/WIDGET_ID
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": 100 }' http://localhost:3030/widgets/WIDGET_ID
@shehaaz
shehaaz / Auth.py
Last active August 29, 2015 14:00
@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")
#!/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
#!/bin/bash
RANGE_HR=200
RANGE_T=32
RANGE_O=50
SLEEP_SECONDS=2
while [ true ]
do
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) )
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) )