Method: FireEagle::Client#within

Defined in:
lib/fireeagle/client.rb

#within(location = {}, count = 10, start = 1) ⇒ Object

Takes a Place ID or a Location and returns a list of users of your application who are within the bounding box of that Location.

Location Hash keys, in order of priority:

[(:lat, :lon)] both required, valid values are floats of -180 to 180 for lat and -90 to 90 for lon [:woeid] Where on Earth ID [:place_id] Place ID [:address] street address (may contain a full address, but will be combined with postal, city, state, and country when available) [(:mnc, :mcc, :lac, :cellid)] cell tower information, all required (as integers) for a valid tower location [:postal] a ZIP or postal code (combined with address, city, state, and country when available) [:city] city (combined with address, postal, state, and country when available) [:state] state (combined with address, postal, city, and country when available) [:country] country (combined with address, postal, city, and state when available) [:q] Free-text fallback containing user input. Lat/lon pairs and geometries will be extracted if possible, otherwise this string will be geocoded as-is.

Not yet supported:

  • upcoming_venue_id
  • yahoo_local_id
  • plazes_id


236
237
238
239
240
241
242
# File 'lib/fireeagle/client.rb', line 236

def within(location = {}, count = 10, start = 1)
  raise FireEagle::ArgumentError, "OAuth Access Token Required" unless @access_token
  location = sanitize_location_hash(location)
  params = { :count => count, :start => start }.merge(location)
  response = get(FireEagle::WITHIN_API_PATH, :params => params)
  FireEagle::Response.parse(response.body).users
end