Expand description
Types and methods for looking up locations.
Location search for Twitter works in one of two ways. The most direct method is to take a
latitude/longitude coordinate (say, from a devide’s GPS system or by geolocating from wi-fi
networks, or simply from a known coordinate) and call reverse_geocode
. Twitter says
reverse_geocode
provides more of a “raw data access”, and it can be considered to merely show
what locations are in that point or area.
On the other hand, if you’re intending to let a user select from a list of locations, you can
use the search_*
methods instead. These have much of the same available parameters, but will
“potentially re-order [results] with regards to the user who is authenticated.” In addition,
the results may potentially pull in “nearby” results to allow for a more broad selection or to
account for inaccurate location reporting.
Since there are several optional parameters to both query methods, each one is assembled as a
builder. You can create the builder with the reverse_geocode
, search_point
, search_query
,
or search_ip
functions. From there, add any additional parameters by chaining method calls
onto the builder. When you’re ready to peform the search call, hand your tokens to call
, and
the list of results will be returned.
Along with the list of place results, Twitter also returns the full search URL. egg-mode
returns this URL as part of the result struct, allowing you to perform the same search using
the reverse_geocode_url
or search_url
functions.
Structs
reverse_geocode
query before it is sent.reverse_geocode
or search
.Enums
Functions
reverse_geocode
, perform the same reverse-geocode search.search_*
function, perform the same location search.