I meant to include this in my last post - https://github.com/alexattia/Maps-Location-History

I was able to perform some additional testing and figured out what portion of the saved curl was the "cookie_content". Indeed, it's obvious now. The cookie is the is that element in the command including everything in that string, including the 'cookie:' label. So, I know what to save.

That git uses this method and also has some great code to capture the daily location history and then parses it and performs varying types of analysis and visualizations. There are a couple of updates to the Google Location History data (LineStrings vs. Tracks) that required a few tweaks (very minor) to the code. I also added a bit to actually save off the coordinates of each "stationary" place logged. It was part of the date. It just wasn't being parsed.

So, I have the KML for the latest day. I'm keeping the logic to just save it to a file rather than trying to figure out how to stream the data back directly. I just call get_kml_file since I'm only interested in the here and now passing the current time year, month, and day. Then I have the great parsing code to get the latest logged Place coordinates. Then I delete the file immediately afterwards.

I'll need a bit of logic to find the most current "Point" in case the latest entry is a "moving" entry.

Google sure is doing everything they can to make life difficult.



P.S. Now the bit about doing this with multiple Google accounts and their associated cookies. And the bit about cookies going stale and needing to be refreshed.

P.P.S. If you have any insights, I'm open to any and all suggestions.