Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
RANGE_HR=200
RANGE_T=32
RANGE_O=50
SLEEP_SECONDS=2
while [ true ]
do
#!/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
@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")
curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "text": 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", "current": 100 }' http://localhost:3030/widgets/WIDGET_ID
<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 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':
>>> list(vertices)
[<Vertex: http://localhost:8182/graphs/graph/vertices/12>, <Vertex:http://localhost:8182/graphs/graph/vertices/40008>]
{
"header": [
{
"host": "lpas"
},
{
"connection": "close"
},
{
"tesla-version": "2"