Inspect HTTP requests with Geographic Data.
Go JavaScript HTML CSS Makefile
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
static
test
.bowerrc
.gitignore
.travis.yml
CHANGELOG.md
LICENSE.txt
Makefile
README.md
bower.json
config.go
config.json.dist
geobin.go
geobin_test.go
geobinrequest.go
geobinrequest_test.go
geobinserver.go
geobinserver_test.go
gtCallback.json
handlers.go
package.json
rediswrapper.go
socket.go
socket_test.go
socketmap.go
socketmap_test.go

README.md

Geobin

Build Status

Inspect HTTP Requests with Geographic Data.

Geobin allows you to create a temporary URL to collect and inspect JSON requests that contain geographic data. Inspect the headers and body of a request and view any geographic data parsed out of the body on a map.

You can also receive data in real time. As long as your browser supports WebSockets, once you're looking at a geobin, new data will be streamed directly to the browser and any found geographic data will be mapped instantly.

Hat tip to RequestBin for inspiration.

Contents

Documentation

Running Geobin locally

Requirements:

Here is the short version of how to get Geobin up and running locally, assuming you have a functional go environment, node environment, and redis server already set up on your machine.

1. go get Geobin

> go get github.com/esripdx/geobin.io

2. Run the setup scripts

> cd $GOPATH/src/github.com/esripdx/geobin.io
> make setup # (runs `go get -t` and `npm install`)

3. Copy/Edit config.json

> cp config.json.dist config.json
> vim config.json # Optional, the defaults will work for running locally and connecting to a local redis on the default port

4. Run the server

> make run

You're up and running, have fun! Try opening http://localhost:8080 in a browser and clicking the "Create a New Geobin" button. Then run the following in a console while keeping an eye on your browser:

> curl -i -X POST \
-H "Content-Type: application/json" \
-d @gtCallback.json http://localhost:8080/BIN_ID

How do we find geographic data?

We look for valid GeoJSON. If no GeoJSON is detected, we'll also look for the following properties:

Latitude & Longitude

  • expected format:
{
  "latitude": 0,
  "longitude": 0
}
  • accepted keys:
    • Latitude:
      • lat
      • latitude
      • y
    • Longitude:
      • lng
      • lon
      • long
      • longitude
      • x

Radius (in meters)

  • expected format:
{
  "latitude": 0,
  "longitude": 0,
  "radius": 0
}
  • accepted keys:
    • dst
    • dist
    • distance
    • rad
    • radius
    • acc
    • accuracy

Coordinates

  • expected format:
{
  "coords": [0,0] // (x (longitude), y (latitude))
}
  • accepted keys:
    • geo
    • loc
    • location
    • coord
    • coordinate
    • coords
    • coordinates

License

Copyright 2014 Esri, Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE.txt file.