Giter Site home page Giter Site logo

whereami's Introduction

WhereAmI

A quick command line tool to get your geographic coordinates using the OS X CoreLocation framework, and optionally get human-readable geolocation data (address, etc.) via the OpenCage API.

Download a zip with the latest version here. As the app is unsigned, on newer versions of Mac OS, you will need to right-click (or control-click) the zip file to open it. See Apple's Knowledge Base for more information.

Usage

Open with Finder to execute, or in the terminal. If it can determine a location, it will output longitude, latitude, accuracy in meters and the time the location was found. WhereAmI tries to get a recent location, and will not display one if it is more than a minute old (to avoid inaccurate results from CoreLocation's cached data). If it cannot get location data, it will quit and print an error message.

Example:

whereami

Output:

Latitude: 45.424807, 
Longitude: -75.699234
Accuracy (m): 65.000000
Timestamp: 2019-09-28, 12:40:20 PM EDT

Geolocation with OpenCage

(Available from version 1.1) Use the -k flag, followed by your OpenCage API key (available here), to get human readable location data.

Example:

whereami -k API_KEY_HERE

Output:

Latitude: 45.424807, 
Longitude: -75.699234
Accuracy (m): 65.000000
Timestamp: 2019-09-28, 12:40:20 PM EDT
111 Wellington St, Ottawa,ON K1A 0A6, Canada

Notes

This is provided on an as-is basis. I make no guarantees or warranties as to its accuracy, stability or compatibility. It should be compatible with Mac OS 10.7 and above. Feel free to do with it as you wish.

Changelog

1.1.0

  • Added support for OpenCage API
  • Updated Xcode project for Xcode 10

1.0.2

  • Fixed missing @autoreleasepool. Shouldn't be any practical changes, but it's good form.

1.0.1

  • WhereAmI will now check if Wi-Fi is not enabled and tell the user such if it can't get location data.

whereami's People

Contributors

robmathers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whereami's Issues

OpenCage Warning

Hi

Thanks a lot for this tool! It works like a charm on BigSur.

I get this warning when using the OpenCage API:
2021-07-06 10:26:25.879 whereami[7395:98604] [NSURLSession sharedSession] may not be invalidated

Doesn't impact the usage, and unfortunately I can't program so I can't fix this and send a PR.

Br
Thomas

Ventura Location Services Access

Currently getting the issue of Access to location services was denied. You may need to enable access in System Preferences. but no setting is available in settings on Ventura. Has anyone solved this?

JSON output

Thank you for this useful tool!

Feature request:
Would be great if you can print the result in JSON.

aligned output and updated deprecated code

diff -r 88c1144ae455 WhereAmI/LocationGetter.m
--- a/WhereAmI/LocationGetter.m Sat Jul 21 22:39:24 2018 +0000
+++ b/WhereAmI/LocationGetter.m Sat Jul 21 14:05:23 2018 -0400
@@ -48,10 +48,10 @@
NSTimeInterval ageInSeconds = -[newLocation.timestamp timeIntervalSinceNow];
if (ageInSeconds > 60.0) return; // Ignore data more than a minute old

  • IFPrint(@"Latitude: %f", newLocation.coordinate.latitude);
  • IFPrint(@"Longitude: %f", newLocation.coordinate.longitude);
  • IFPrint(@"Accuracy (m): %f", newLocation.horizontalAccuracy);
  • IFPrint(@"Timestamp: %@", [NSDateFormatter localizedStringFromDate:newLocation.timestamp
  • IFPrint(@"Latitude : %10.6f", newLocation.coordinate.latitude);

  • IFPrint(@"Longitude : %10.6f", newLocation.coordinate.longitude);

  • IFPrint(@"Accuracy (m): %10.6f", newLocation.horizontalAccuracy);

  • IFPrint(@"Timestamp : %@", [NSDateFormatter localizedStringFromDate:newLocation.timest

    [self.manager stopUpdatingLocation];
    self.exitCode = 0;
    @@ -59,7 +59,7 @@
    }

-(BOOL)isWifiEnabled {

  • CWInterface *wifi = [CWInterface interface];
  • CWInterface *wifi = [CWWiFiClient init];
    return wifi.powerOn;
    }

Not working in Catalina

When I installed a copy of 1.1.0 onto a machine with 10.15.6 on it, I get an "zsh: exec format error" when I try to just execute the binary, and when I sudo it, I get "cannot execute binary file".

Switching from zsh to bash gets me the "cannot execute binary file" no matter what.

Any idea if it's possible to get this working with Catalina?

Not an issue as well, I've made a Brew cask

If anyone interested, you can install robmathers/WhereAmI via Homebrew cask by tapping welldan97/whereami:

$ brew tap welldan97/whereami
==> Tapping welldan97/whereami
Cloning into '/opt/boxen/homebrew/Library/Taps/welldan97/homebrew-whereami'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
Checking connectivity... done.
Tapped 0 formulae (28 files, 17.2K)

$ brew cask install whereami
==> Downloading https://github.com/robmathers/WhereAmI/releases/download/v1.02/whereami-1.02.zip
######################################################################## 100.0%
==> Verifying checksum for Cask whereami
==> Symlinking Binary 'whereami' to '/usr/local/bin/whereami'
๐Ÿบ  whereami staged at '/opt/homebrew-cask/Caskroom/whereami/latest' (36K)

$ whereami
Latitude: 56.320993
Longitude: 44.027497
Accuracy (m): 65.000000
Timestamp: 01/03/2016, 12:11:27 GMT+3

Automation issues

Hi there,

We're trying to deploy whereami in a script that is run on an interval using launchd and for some reason it can't execute it in this environment. The same is true when trying to run it using cron. We can run it manually in the CLI all day (both the utility and the script containing it) but we've had no success using the native macOS automation tools. Here's an example of the plist we've been using:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>Label</key>
		<string>org.metroeast.whereami</string>
		<key>ProgramArguments</key>
		<array>
                 <string>/usr/local/bin/whereami</string>
                </array>
		<key>RunAtLoad</key>
		<true/>
		<key>StartInterval</key>
		<integer>3600</integer>
                 <key>StandardOutPath</key>
                 <string>/tmp/whereami.now</string>
                 <key>StandardErrorPath</key>
                <string>/tmp/whereami.now</string>
	</dict>
</plist>

We tested the date utility in the same launchd file to make sure it would run something else and it did. Any ideas?

What is the license on this?

I don't see a mention of one in the readme, nor a LICENSE, COPYING file. Could you please choose and add one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.