Update: July 2018
This script is no longer working due to some changes by MyFitnesspal
Source code is available if you want to try and get it working:
I wrote this php script as MyFitnesspal does not have the functionality available to import a historical list of weight/body fat values.
After looking at the http post values I came up with a script to read a file and post the values to the MFP site.
In order to upload the data you need to provide your MFP credentials, the script then logs onto MFP and creates a drop down options box based on your settings in MFP.
You will then need to provide a text file containing the data and weight (or Body fat, or what ever you want to import)
The data will also need to be tab delimited with no blank line of the last line of the scipt. The data will then be uploaded to MFP – it took a good few mins to upload about 2 years of my data so just be patient. Not sure if this is a limitation on the MFP side.
One problem I have noticed is that the first and last values uploaded always contain the wrong vlaue. I will need to fix this up but please we aware of this.
The script also does not check if the data already exists – I’m not sure what would happen. Haven’t tested it.
There are bound to be a few bugs in this. Let me know if you find any. I’ve uploaded 4 years of weight values and it seems to have been uploaded successfully.
After the script has finished the uploaded file and cookies are delete. No personal data is stored on the server.
Update: Busy relooking at my code. Seems MFP has changed something and it no longer works 🙁