export works somehow (no coordinates)
This commit is contained in:
@@ -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 %}
|
||||
|
||||
@@ -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 |
Reference in New Issue
Block a user