Skip to content

Instantly share code, notes, and snippets.

@quells
Forked from ttscoff/whereami.sh
Last active August 29, 2015 14:03
Show Gist options
  • Save quells/c08fde9cd9c81f069a3e to your computer and use it in GitHub Desktop.
Save quells/c08fde9cd9c81f069a3e to your computer and use it in GitHub Desktop.
#!/bin/bash
alias whereami="get-location 2> /dev/null | sed -e 's/.*<\(.*\)>.*/\1/' | sed -e 's/\(.*\)/http:\/\/maps.googleapis.com\/maps\/api\/geocode\/json\?latlng\=\1\&sensor\=false/' | xargs curl -Ss | grep 'formatted_address' | head -n 1 | sed -e 's/[ \t]*\"formatted_address\" : \"\(.*\)\",/\1/'"
@quells
Copy link
Author

quells commented Jul 2, 2014

ttscoff:

You'll need get-location (and the Command Line Tools to compile it) to make this work. It's cool when it does, though.

Condensed to a single line for inclusion in .bash_profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment