module FoursquareNext::Lists

Public Instance Methods

add_list(options = {}) click to toggle source

Add a list: See developer.foursquare.com/docs/lists/add

@param [Hash] options @option options String :name - (required) The name of the list @option options String :description - The description of the list. @option options Boolean :collaborative - Boolean indicating if this list can be edited by friends. @option options String :photoId - The id of a photo that should be set as the list photo.

# File lib/foursquare_next/lists.rb, line 26
def add_list(options = {})
  response = connection.post do |req|
    req.url "lists/add", options
  end
  return_error_or_body(response, response.body.response.list)
end
add_list_item(list_id, options = {}) click to toggle source

Add an item to a list: developer.foursquare.com/docs/lists/additem

@param [String] list_id - The id of the list to update @param [Hash] options (all optional) @option options String :venueId - A venue to add to the list. @option options String :text - text to add to item @option options String :url - associate a url with the tip @option options String :tipId - Used to add a tip to a list @option options String :listId - Used with itemId to copy item from a list @option options String :itemId - Used with listId to copy item from a list

# File lib/foursquare_next/lists.rb, line 82
def add_list_item(list_id, options = {})
  response = connection.post do |req|
    req.url "lists/#{list_id}/additem", options
  end
  return_error_or_body(response, response.body.response.item)
end
delete_list_item(list_id, item_id, options = {}) click to toggle source

Delete an item from a list: developer.foursquare.com/docs/lists/deleteitem

@param [String] list_id - The id of the list to delete item from @param [String] item_id = The id of the item to delete from list

# File lib/foursquare_next/lists.rb, line 94
def delete_list_item(list_id, item_id, options = {})
  response = connection.post do |req|
    req.url "lists/#{list_id}/deleteitem", { :itemId => item_id }.merge(options)
  end
  return_error_or_body(response, response.body.response.item)
end
follow_list(list_id, options = {}) click to toggle source

Follow a list: developer.foursquare.com/docs/lists/follow

@param [String] list_id - The id of the list to follow.

# File lib/foursquare_next/lists.rb, line 37
def follow_list(list_id, options = {})
  response = connection.post do |req|
    req.url "lists/#{list_id}/follow", options
  end
  return_error_or_body(response, response.body.response.list)
end
list(list_id, options = {}) click to toggle source

Retrieve information about a list.

@param [String] list_id - The id of the list to retrieve. @param [Hash] options @option options Integer :limit - Number of results to return, up to 200. @option options Integer :offset - The number of results to skip. Used to page through results.

# File lib/foursquare_next/lists.rb, line 11
def list(list_id, options = {})
  response = connection.get do |req|
    req.url "lists/#{list_id}", options
  end
  return_error_or_body(response, response.body.response.list)
end
move_list_item(list_id, item_id, options = {}) click to toggle source

Move an item on a list: developer.foursquare.com/docs/lists/moveitem

@param [String] list_id - The id of the list on which the item is moved @param [String] item_id = The id of the item to move @param [Hash] options @option options String :beforeId - (optional) move itemId before beforeId @option options String :afterId - (optional) move itemId after afterId

# File lib/foursquare_next/lists.rb, line 109
def move_list_item(list_id, item_id, options = {})
  response = connection.post do |req|
    req.url "lists/#{list_id}/moveitem", { :itemId => item_id }.merge(options)
  end
  return_error_or_body(response, response.body.response.list)
end
unfollow_list(list_id, options = {}) click to toggle source

Unfollow a list: developer.foursquare.com/docs/lists/unfollow

@param [String] list_id - The id of the list to unfollow.

# File lib/foursquare_next/lists.rb, line 48
def unfollow_list(list_id, options = {})
  response = connection.post do |req|
    req.url "lists/#{list_id}/unfollow", options
  end
  return_error_or_body(response, response.body.response.list)
end
update_list(list_id, options = {}) click to toggle source

Update a list: developer.foursquare.com/docs/lists/update

@param [String] list_id - The id of the list to update @param [Hash] options @option options String :name - The name of the list @option options String :description - The description of the list. @option options Boolean :collaborative - Boolean indicating if this list can be edited by friends. @option options String :photoId - The id of a photo that should be set as the list photo.

# File lib/foursquare_next/lists.rb, line 64
def update_list(list_id, options = {})
  response = connection.post do |req|
    req.url "lists/#{list_id}/update", options
  end
  return_error_or_body(response, response.body.response.list)
end