Skip to content

Instantly share code, notes, and snippets.

@benjamingwynn
Created October 11, 2020 19:14
Show Gist options
  • Save benjamingwynn/0eedc4da68f794d6c07b338a150c448c to your computer and use it in GitHub Desktop.
Save benjamingwynn/0eedc4da68f794d6c07b338a150c448c to your computer and use it in GitHub Desktop.
Calculate how often Google Location data is recorded/sent to Google using Location History.json from Google Takeout
// use nodejs to load location history.json from your google takeout folder -b
var data=require('./Location History')
var times=data.locations.map(d=>parseInt(d.timestampMs))
var between=times.map((t,i) => times[i-1] ? t-times[i-1] : 0 )
var mean=between.reduce((a,v)=>a+v)/between.length
var meanInMinutes=mean/1000/60
console.log("Google location data reported every " + meanInMinutes + " minutes.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment