{"id":1264,"date":"2012-11-30T09:07:49","date_gmt":"2012-11-30T08:07:49","guid":{"rendered":"https:\/\/www.bytopia.dk\/blog\/?p=1264"},"modified":"2014-06-30T10:46:20","modified_gmt":"2014-06-30T08:46:20","slug":"download-all-workouts-from-endomondo","status":"publish","type":"post","link":"https:\/\/www.bytopia.dk\/blog\/2012\/11\/30\/download-all-workouts-from-endomondo\/","title":{"rendered":"Download all workouts from Endomondo"},"content":{"rendered":"<p><strong>Update: I quit using Endomondo some time ago and no longer maintain this script. If it still works, great! If it doesn&#8217;t and you can\u00a0make it work\u00a0for you, great!\u00a0If you want to take it and maintain it, feel free to do so.<\/strong><\/p>\n<p><strong>Update 2: <a href=\"http:\/\/www.kallisti.co.uk\/sport-tech-new-toys-and-moving-data\/\">Stephen Casey<\/a> has modified this script so it should work again. Please check out <a href=\"http:\/\/www.kallisti.co.uk\/sport-tech-new-toys-and-moving-data\/\">his website<\/a> for a description and a link to the updated script.<\/strong><\/p>\n<p>As many people around the world I like to do some exercise now and then, and when that exercise is running I save all my workouts to <a href=\"http:\/\/endomondo.com\">Endomondo<\/a>. I have been doing this for over two years now, and have accumulated more than 300 workouts. Recently Endomondo decided to limit the amount of features available for free, and move them to a subscription part of the website. While I have no problems with paying for what I use, I consider it a bad move to start charging for features that used to be free. It doesn&#8217;t really affect me that much though, since I never used those features anyway. However, it got me thinking that should Endomondo decide to do something similar in the future, I won&#8217;t have the option to switch platform since they hold all my workout data. There is a possibility to export one workout at a time, but Endomondo <a href=\"https:\/\/getsatisfaction.com\/endomondo\/topics\/how_do_i_export_all_of_my_workouts_at_one\">clearly stated that a mass export function will not be available<\/a>. I was not satisfied by this so I wrote a script to export all my workouts from Endomondo, and I am posting it here in case some of you want to get all your data back from Endomondo too. After all it&#8217;s YOUR data. The script is written in PHP and runs from the command line. For Windows I have put everything needed into a single file. For Linux \u00a0and OSX you need to install PHP yourself. Also, in order for the script to work you need to login in one of the following ways:<\/p>\n<ol>\n<li><span style=\"line-height: 13px;\" data-mce-mark=\"1\">Put your username and password in a file called secret.txt where the first line is the username and the second line is the password. This does not work with Facebook logins and also requires OpenSSL support in your PHP installation.<\/span><\/li>\n<li>Get the cookie used to authenticate you and put the cookie \u00a0(everything after &#8220;Cookie: &#8221; or the entire line, it doesn&#8217;t matter)\u00a0in a file called cookie.txt. You can get the cookie in several ways: With Wireshark, using Chrome:\u00a0(F12, reload page in Endomondo, Network, click on one of the resources under headers)\u00a0or with some extension like TamperData for Firefox.<\/li>\n<\/ol>\n<p>If both files exist, username and password authentication takes priority. The script will first download a list of all your workouts, then download the actual workouts. It will remember the the latest workout that was downloaded, so if you run it again at a later point in time, you will only get new workouts. You can modify the function generateFileName to change the filenames of the saved workouts. <strong>Disclaimer:<\/strong> <em>This script worked for me. Endomondo can easily change something on their website so this script does not work anymore, so I offer no guarantee that it will work for you. Use this script at your own risk.<\/em> You can <a href=\"https:\/\/www.bytopia.dk\/blog\/wp-content\/uploads\/2012\/11\/getworkouts.zip\">download the script for Linux and OSX<\/a>\u00a0or you can\u00a0<a href=\"https:\/\/www.bytopia.dk\/blog\/wp-content\/uploads\/2013\/01\/getworkouts-windows.zip\">download everything needed to run it under Windows<\/a>. If you&#8217;re using Windows you should extract the Endomondo directory from the ZIP file and execute the file <em>run.cmd<\/em>. For any other OS you should just execute\u00a0<em>php getworkouts.php<\/em>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: I quit using Endomondo some time ago and no longer maintain this script. If it still works, great! If it doesn&#8217;t and you can\u00a0make it work\u00a0for you, great!\u00a0If you want to take it and maintain it, feel free to do so. Update 2: Stephen Casey has modified this script so it should work again. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[4,20],"tags":[],"class_list":["post-1264","post","type-post","status-publish","format-standard","hentry","category-computer","category-english"],"_links":{"self":[{"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/posts\/1264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/comments?post=1264"}],"version-history":[{"count":20,"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/posts\/1264\/revisions"}],"predecessor-version":[{"id":1518,"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/posts\/1264\/revisions\/1518"}],"wp:attachment":[{"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/media?parent=1264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/categories?post=1264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bytopia.dk\/blog\/wp-json\/wp\/v2\/tags?post=1264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}