Skip to content

Instantly share code, notes, and snippets.

@erichurst
erichurst / Geo.js
Created March 16, 2010 21:03 — forked from kara-ryli/Geo.js
var Geo = navigator.geolocation, // {Object|null} a shortcut to the geolocation static class
options = { // {Object} options available to calls for position
enableHighAccuracy: false, // {Boolean} Whether or not to use more resources to get a more accurate position
maximumAge: 0, // {Number|Infinity} The maximum number of milliseconds since the last check.
timeout: null // {Number|null} The maximum number of milliseconds to wait for a fix
},
watchId; // {Number} an ID to a watch timeout
// handles an error finding the user's position
function onError(error) {
require 'twitter'
Twitter::Search.new.geocode(39.037, -94.5874, '5mi').fetch().results
#=> all tweets within 5 miles of lat/lon
Twitter::Search.geocode(39.037, -94.5874, '5mi').fetch().results.first
#=> most recent tweet within 5 miles of lat/lon
Twitter::Search.new('dinner').geocode(39.037, -94.5874, '5mi').fetch().results
#=> all tweets containing the word 'dinner' within 5 miles of lat/lon