Private
Public Access
1
0

export works somehow (no coordinates)

This commit is contained in:
Sander Roosendaal
2017-04-16 19:42:37 +02:00
parent b77f24e13b
commit 845710c7b4
3 changed files with 22 additions and 9 deletions

View File

@@ -124,7 +124,7 @@
{% endif %}
{% else %}
<div class="grid_1">
<a href="https://underarmour.com/fitnessActivity/{{ workout.uploadedtounderarmour }}">
<a href="https://www.mapmyfitness.com/workout/{{ workout.uploadedtounderarmour }}">
<img src="/static/img/uachecked.png" alt="Underarmour icon" width="60" height="60"></a>
</div>
{% endif %}

View File

@@ -238,12 +238,12 @@ def createunderarmourworkoutdata(w):
haslatlon = 0
# short for debugging
# t = t[:3]
# d = d[:3]
# lat = lat[:3]
# hr = hr[:3]
# lon = lon[:3]
# spm = spm[:3]
t = t[:10]
d = d[:10]
lat = lat[:10]
hr = hr[:10]
lon = lon[:10]
spm = spm[:10]
# path data
if haslatlon:
@@ -283,9 +283,11 @@ def createunderarmourworkoutdata(w):
}
aggregrates = {
"elapsed_time_total": duration,
"distance_total": max(d),
"elapsed_time_total": int(duration),
"distance_total": int(max(d)),
"heartrate_avg": averagehr,
"heart_rate_min": int(min(hr)),
"heart_rate_max": int(max(hr)),
}
# if haslatlon:
@@ -312,6 +314,17 @@ def get_idfromuri(user,links):
return id,typename
def getidfromresponse(response):
t = json.loads(response.text)
links = t["_links"]
id = links["self"][0]["id"]
return int(id)
def get_typefromid(typeid,user):
r = Rower.objects.get(user=user)
authorizationstring = str('Bearer ' + r.underarmourtoken)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 35 KiB