Skip to content

Instantly share code, notes, and snippets.

@Akeri
Last active March 8, 2020 17:25
Show Gist options
  • Select an option

  • Save Akeri/4db0d06b4de5ea4c5a9dc69e386b1734 to your computer and use it in GitHub Desktop.

Select an option

Save Akeri/4db0d06b4de5ea4c5a9dc69e386b1734 to your computer and use it in GitHub Desktop.
Search along all Runtastic exported gpx by a date
const glob = require('glob');
const gpxParse = require('/usr/local/lib/node_modules/gpx-parse');
const moment = require('moment');
const exportDir = '';
const path = `${exportDir}/Sport-sessions/GPS-data/*.gpx`;
glob.sync(path).forEach((file) => {
gpxParse.parseGpxFromFile(file, (error, result) => {
const time = result.tracks[0].segments[0][0].time;
const date = moment(time);
if (date.isAfter(moment('2020-03-07'))) {
console.log(file);
console.log(time);
return false;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment