Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

maxdec/foursquare2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

foursquare2

Ruby wrapper for the foursquare v2 API.

Installation

sudo gem install foursquare2

Usage

A Note on Authentication

Currently this gem does not handle the oauth2 authentication flow for you, use the oauth2 gem to retrieve and store oauth tokens for a user. Obtain your client key/secret for userless access at the foursquare developer site.

Instantiate a client (Userless Access)

client = Foursquare2::Client.new(:client_id => 'your_client_id', :client_secret => 'your_secret')

Instantiate a client (Authenticated User Access)

client = Foursquare2::Client.new(:oauth_token => 'user_oauth_token')

Instantiate a client (With versioning)

client = Foursquare2::Client.new(:api_version => '20120505')

Examples

See the documentation for a list of all supported methods and available options.

Get information about a user (use 'self' for the authenticated user)

client.user(108914)

Get information about a venue

client.venue(5104)

Search for venues

client.search_venues(:ll => '36.142064,-86.816086', :query => 'Starbucks')

Check-in to a venue as the authenticated user

client.add_checkin(:venueId => "4b2afcaaf964a5205bb324e3", :broadcast => 'public', :ll => '36.142064,-86.816086', :shout => 'zomg coffee!1!')

Search user by tip

 client.search_users_by_tip(:ll => '36.142064,-86.816086', :name => 'Marco')

Search tips from a user (optionally filter a user's tips based on some term)

 client.user_tips("123456", :query => 'coffee')

Search venues by tip

 client.search_venues_by_tip(:ll => '36.142064,-86.816086', :query => 'coffee')

Search tips at a venue (optionally filter a venue's tips based on some term)

 client.venue_tips("4b2afcaaf964a5205bb324e3", :query => 'coffee')

Full list of methods