Login required to started new threads

Login required to post replies

Getting Weight History from Withings to WKO
Quote | Reply
I have managed to get about 10-15 years of my historical weight into Withings. My objective is to have this make its way to WKO.

I hoped the data could travel Withings-TrainingPeaks->WKO through existing links between these. Although Withings and TrainingPeaks are linked, and new weight entires will automatically appear in TrainingPeaks as a new Metric, I can't figure out how to carry over the historical Withings weight data to then appear as historical TrainingPeaks Metrics. I've reestablished the connection/link a few times to try to reset, but no luck.

Any tips? The final destination for the weight data will be WKO5.
Quote Reply
Re: Getting Weight History from Withings to WKO [davetallo] [ In reply to ]
Quote | Reply
Can't help as my javascript skills aren't that great but you could probably do an API call thru the browser console to import the data in there.
Someone wrote a similar script that can create a trainerroad workout into the workout library to add to the TP calendar.

IG - @ryanppax
http://www.geluminati.com
Use code ST5 for $5 off your order
Quote Reply
Re: Getting Weight History from Withings to WKO [Ryanppax] [ In reply to ]
Quote | Reply
yknow what, I'm going to take a stab at this after work and training today. Lemme see what I can do.

https://github.com/.../wiki/Metrics-Create

IG - @ryanppax
http://www.geluminati.com
Use code ST5 for $5 off your order
Quote Reply
Re: Getting Weight History from Withings to WKO [davetallo] [ In reply to ]
Quote | Reply
:D

Okay now i really need to get back to work BUT i successfully imported a single weight metric. Note it is in kg. Next step is to create a JSON array of all your weight data and loop over the entries
replace <trainingpeaks ID > with the actual ID number. You can your profile id by opening the network tab chrome dev tools, then add a metric and save. You will see an entry called "timedmetrics" and the id will be in the request URL

var data = {
"id":null,
"athleteId": <trainingpeaks ID >,
"details": [{"type": 9, "value": 20.41168092460379}],
"timeStamp": "2020-06-12T00:00:00"};


fetch("https://tpapi.trainingpeaks.com/...es/<trianingpeaks ID>/timedmetrics", { method: 'POST', body: JSON.stringify(data), credentials:"include",headers: {'Content-Type': 'application/json'}}).then(res => res.json()).then(console.log)

Copy and pasting this into my chrome console gave the entry for June 12

IG - @ryanppax
http://www.geluminati.com
Use code ST5 for $5 off your order
Quote Reply
Re: Getting Weight History from Withings to WKO [Ryanppax] [ In reply to ]
Quote | Reply
Wow! That is an incredibly generous use of your time. I appreciate it - I’ll definitely pay the kindness forward.
Quote Reply
Re: Getting Weight History from Withings to WKO [davetallo] [ In reply to ]
Quote | Reply
Hey Dave, if you still find this too technical let me know and I can conferance call with you.
This is kinda of a hacky way to do it but it works.

I'm not sure what the data from Withings looks like but you'll want to get an export of it if you can.
You'll need to make a small csv file of the data in the format of
<weight>,<date>

Weight is in pounds
Date needs formatted as year-month-day ####-##-##

Once you have that use this link,
https://codepen.io/ryanppax/pen/BajjzEv
It will generate the code you need to put into your browser console on the Calendar Page.

I made a short video going through the process.


There is no data validation programmed in so make sure the csv is exactly as the example given.
I would recommend doing a test first using a few weight metrics before doing the whole thing. Depending on how many metrics you are uploading it may help do smaller batches until you finish.

Let me know if you have any issues!



IG - @ryanppax
http://www.geluminati.com
Use code ST5 for $5 off your order
Last edited by: Ryanppax: Jun 9, 20 20:07
Quote Reply