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 %} {% endif %}
{% else %} {% else %}
<div class="grid_1"> <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> <img src="/static/img/uachecked.png" alt="Underarmour icon" width="60" height="60"></a>
</div> </div>
{% endif %} {% endif %}

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 35 KiB