module FoursquareNext::Tips
Public Instance Methods
Add a tip
@param [Hash] options @option options String :venueId - Required, which venue to add the tip to. @option options String :text - The text of the tip. @option options String :url - Optionally associated url.
# File lib/foursquare_next/tips.rb, line 56 def add_tip(options={}) response = connection.post do |req| req.url "tips/add", options end return_error_or_body(response, response.body.response.tip) end
Mark a tip done for the authenticated user.
param [String] tip_id - The id of the tip to mark.
# File lib/foursquare_next/tips.rb, line 78 def mark_tip_done(tip_id, options={}) response = connection.post do |req| req.url "tips/#{tip_id}/markdone", options end return_error_or_body(response, response.body.response) end
Mark a tip todo for the authenticated user.
param [String] tip_id - The id of the tip to mark.
# File lib/foursquare_next/tips.rb, line 67 def mark_tip_todo(tip_id, options={}) response = connection.post do |req| req.url "tips/#{tip_id}/marktodo", options end return_error_or_body(response, response.body.response) end
Search for tips.
@param [Hash] options @option options String :ll - Latitude and longitude in format LAT,LON @option options Integer :limit - The limit of results to return. @option options Integer :offset - Used to page through results. @option options String :filter - Set to 'friends' to limit tips to those from friends. @option options String :query - Only find tips matching this term.
# File lib/foursquare_next/tips.rb, line 23 def search_tips(options={}) response = connection.get do |req| req.url "tips/search", options end return_error_or_body(response, response.body.response.tips) end
Retrieve information about a tip.
param [String] tip_id - The id of the tip to retrieve.
# File lib/foursquare_next/tips.rb, line 7 def tip(tip_id, options={}) response = connection.get do |req| req.url "tips/#{tip_id}", options end return_error_or_body(response, response.body.response.tip) end
Unmark a tip todo for the authenticated user.
param [String] tip_id - The id of the tip to unmark.
# File lib/foursquare_next/tips.rb, line 89 def unmark_tip(tip_id, options={}) response = connection.post do |req| req.url "tips/#{tip_id}/unmark", options end return_error_or_body(response, response.body.response) end
Search for tips from a venue.
@param [String] venue_id - Venue id to flag, required. @param [Hash] options @option options String :sort [recent] One of recent or popular. @option options Integer :limit [100] Number of results to return, up to 500. @option options Integer :offset [100] Used to page through results @option options String :query - Only find tips matching this term.
# File lib/foursquare_next/tips.rb, line 39 def venue_tips(venue_id, options={}) query = options.delete(:query) response = connection.get do |req| req.url "venues/#{venue_id}/tips", options end tips = return_error_or_body(response, response.body.response.tips) tips = FoursquareNext.filter(tips, query) if query tips end