Module: Twitter::REST::PlacesAndGeo
Constant Summary
Constants included from Utils
Instance Method Summary collapse
-
#geo_search(options = {}) ⇒ Array<Twitter::Place>
(also: #places_nearby)
Search for places that can be attached to a Tweets#update.
-
#place(place_id, options = {}) ⇒ Twitter::Place
Returns all the information about a known place.
-
#reverse_geocode(options = {}) ⇒ Array<Twitter::Place>
Searches for up to 20 places that can be used as a place_id.
-
#similar_places(options = {}) ⇒ Array<Twitter::Place>
(also: #places_similar)
Locates places near the given coordinates which are similar in name.
Methods included from Utils
Instance Method Details
#geo_search(options = {}) ⇒ Array<Twitter::Place> Also known as: places_nearby
Search for places that can be attached to a Tweets#update
58 59 60 |
# File 'lib/twitter/rest/places_and_geo.rb', line 58 def geo_search( = {}) perform_get_with_object("/1.1/geo/search.json", , Twitter::GeoResults) end |
#place(place_id, options = {}) ⇒ Twitter::Place
Returns all the information about a known place
19 20 21 |
# File 'lib/twitter/rest/places_and_geo.rb', line 19 def place(place_id, = {}) perform_get_with_object("/1.1/geo/id/#{place_id}.json", , Twitter::Place) end |
#reverse_geocode(options = {}) ⇒ Array<Twitter::Place>
This request is an informative call and will deliver generalized results about geography.
Searches for up to 20 places that can be used as a place_id
37 38 39 |
# File 'lib/twitter/rest/places_and_geo.rb', line 37 def reverse_geocode( = {}) perform_get_with_object("/1.1/geo/reverse_geocode.json", , Twitter::GeoResults) end |
#similar_places(options = {}) ⇒ Array<Twitter::Place> Also known as: places_similar
Conceptually, you would use this method to get a list of known places to choose from first. Then, if the desired place doesn't exist, make a request to #place to create a new one. The token contained in the response is the token necessary to create a new place.
Locates places near the given coordinates which are similar in name
77 78 79 |
# File 'lib/twitter/rest/places_and_geo.rb', line 77 def similar_places( = {}) perform_get_with_object("/1.1/geo/similar_places.json", , Twitter::GeoResults) end |