Module: Instagram::Client::Locations
- Included in:
- Instagram::Client
- Defined in:
- lib/instagram/client/locations.rb
Overview
Defines methods related to media items
Instance Method Summary collapse
-
#location(id) ⇒ Hashie::Mash
Returns extended information of a given Instagram location.
-
#location_recent_media(id, options = {}) ⇒ Hashie::Mash
Returns a list of recent media items for a given Instagram location.
-
#location_search(options = {}) ⇒ Hashie::Mash
Returns Instagram locations within proximity of given lat,lng or foursquare venue id.
Instance Method Details
#location(id) ⇒ Hashie::Mash
Returns extended information of a given Instagram location
16 17 18 19 |
# File 'lib/instagram/client/locations.rb', line 16 def location(id, *args) response = get("locations/#{id}") response end |
#location_recent_media(id, options = {}) ⇒ Hashie::Mash
Returns a list of recent media items for a given Instagram location
35 36 37 38 39 |
# File 'lib/instagram/client/locations.rb', line 35 def location_recent_media(id, *args) = args.last.is_a?(Hash) ? args.pop : {} response = get("locations/#{id}/media/recent", ) response end |
#location_search(options = {}) ⇒ Hashie::Mash
Returns Instagram locations within proximity of given lat,lng or foursquare venue id
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/instagram/client/locations.rb', line 57 def location_search(*args) = args.last.is_a?(Hash) ? args.pop : {} case args.size when 1 foursquare_v2_id = args.first response = get('locations/search', .merge(:foursquare_v2_id => foursquare_v2_id)) when 2 lat, lng = args response = get('locations/search', .merge(:lat => lat, :lng => lng)) when 3 lat, lng, distance = args response = get('locations/search', .merge(:lat => lat, :lng => lng, :distance => distance)) end response end |