Export Moves-Export Storylines to Single-Day GPX Files

Posted by on 7th Apr 2016

This solution is butt ugly! But I tried to export my Moves data a couple of times now, and it didn't work as I expected it to. I'd like to have every single day as single GPX files, just as their own automated Dropbox export does. With this workflow, I was able to make it work finally work. It's not super straight forward, and not a round solution, technically, but in about 30 minutes you are going to have all your data, to do whatever you want with it. I believe that's a fair trade.

Go to moves-export.com and view your history. The important information here is your first and last day. Please take a look at the link of the day itself. The displayed text, and the storyline URL is always one day off. So if it says 2016-04-07 (YYYY-MM-DD format) on the page, the URL is actually something like startdate=20160406. Notice that the day is one day behind.

We need to generate a list of URL's to download. I couldn't get this to work with curl, so I did it differently, and it's going to put some pressure on your browser!

{% img center /images/2016-04-07-export-moves-export-storylines-to-single-day-gpx-files.jpg 460 54 'Google Sheets' %}

(Open image to view in original size.)

  • Open a new spreadsheet and create a list of dates. I did this in Google Sheets.
  • First column should have everything in front of startdate. So it'll be http://www.moves-export.com/gpxactivity?type=storyline&startdate= in my case.
  • The second column will hold the dates to export. Type in the current day's date. Then go to Format → Number → More Formats → More date and time formats.
  • Choose one that comes close to the expected date format. I took the one with - between and removed the - signs.
  • Now fill the entire column until your first/last day in Moves Export. (Highlight the second columns' box and click the square bottom right of the selected cell, then drag upwards or downwards.) This will fill the entire column with dates in the chosen format.
  • Select the second column, go to the third column and paste everything. Then while it's still selected go to Format → Plain Text. This should leave the text, and only the text, and remove the formatting we chose earlier.
  • Now in the third column create a new formula: =A1&C1, and hit return. It will concatenate the text in the first column, and third.
  • Select the third column and copy the text to a new text file.

This new text file now has ALL download links, of every day (even those where Moves didn't work properly).

Create a new shell script with the following content (OS X 10.11).

#!/bin/sh

for file in $(<dl-list.txt)
do
    open "$file"
done

!!! Note: The open command is going to open EVERY. SINGLE. LINE. in your default browser. I couldn't get any of download manager to resolve the download correctly. It only worked, when logged into moves-export.com, and in the browser. Therefore I figured the easiest solution is to let the browser do the heavy work, and just wait for it to finish. Which it did. Eventually.

Now execute the shell script, and wait. In my case I'm using Google Chrome as browser, and it didn't catch all downloads. I had to manually ⌘R each page where it didn't load, but that's a small price to pay, considering I don't have to click small little links on a page. The easy thing is that you can hold ⌘ then type wr, wr, wr, etc. This will reload the page, and close the tab, reload, close, reload, close. In the end I ended up with exactly the amount of GPX files, that I had in my text file of download URL's. You can check the correctness with a file diff. Some of the segment names are off, but the track itself is the same.