fulldecent / corelocationcli

Command line program to print location information from CoreLocation
MIT License
217 stars 29 forks source link

No need to disable "follow" with JSON output #25

Closed purcell closed 4 years ago

purcell commented 4 years ago

With "follow" enabled, the JSON output effectively becomes jsonlines output, which isn't so bad. This means a stream of output with -json -follow could usefully be read by another program, so it's not helpful to disable that possibility. In fact, I have a use case for which this behaviour would be ideal.

purcell commented 4 years ago

Also thanks for this useful program!

fulldecent commented 4 years ago

Thank you, good suggestion. Fixing this is in the project scope.

Also, documentation should be updated to explain that output could be complaint with JSON lines, and will definitely not be compliant with JSON, when using --follow.

Would you like to start a patch for this?

purcell commented 4 years ago

I can easily do that, but the bigger issue is the currently invalid JSON output noted in #19.

fulldecent commented 4 years ago

Fixed in latest version. Requesting testing.

Will need to compile from source because this latest update is not yet in Homebrew.

purcell commented 4 years ago

That seems to work, though with -follow it seems to update many times per second, even when the location data isn't changing, and then fairly quickly the geocoding API starts rejecting calls, presumably due to rate limiting.

fulldecent commented 4 years ago

Thank you, fixed in 4049dad

purcell commented 4 years ago

Nice — that works very well!