Giter VIP home page Giter VIP logo

whereami's Introduction

Build Status

So what is it?

whereami is a simple command-line utility that outputs your geographical coordinates, as determined by Core Location, which uses nearby WiFi networks with known positions to pinpoint your location. It prints them to the standard output in an easy to parse format, in good UNIX fashion.

Requirements

This version of whereami only works in versions of Mac OS X 10.9 (Mavericks) or greater; as it is implemented in Swift. Why in Swift? Well, mostly because the command-line parsing libraries I could find in Objective-C where either a nuisance to install (because of lack of CocoaPods support) or required a lot of code to configure the options I need. On the other hand, SwiftCLI makes it really easy.

To build it, you will require Xcode 6.1 and optionally xctool. You can build it from the command line using either xcodebuild or xctool, whichever you like best. Both should work equally well, but xctool’s output is fancier. You can install xctool using homebrew.

INSTALLATION

whereami comes with batteries included. You just need to clone the project to your local machine, switch to the swift branch, init the submodules, and install it using xcodebuild/xctool. In the near future, I will make that branch the main one, but not just yet.

$ git clone https://github.com/victor/whereami.git whereami
$ cd whereami
$ git checkout swift
$ git submodule update --init --recursive
$ xctool install

USAGE

Once whereami is installed, you can just invoke it to output your location:

$ whereami
41.386905825791,2.14425782089087

This is the default format, the tersest. You can also make it output JSON:

$ whereami --format json
{"latitude":41.386905825791, "longitude": 2.14425782089087}

Or even output in sexagesimal form:

$ whereami --format sexagesimal
41° 23′ 12.8609728477426″, 2° 8′ 39.3281552071449″

Apart from these options, the standard --version and --help options are recognized.

CONTRIBUTING

Please see CONTRIBUTING.md for details.

LICENSE

This code is released under the MIT license. Check the file LICENSE for details.

whereami's People

Contributors

victor avatar joelparkerhenderson avatar

Watchers

James Cloos avatar dexter.lei avatar

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.