<commit_before># foursquare2

Ruby wrapper for the [foursquare v2 API](http://developer.foursquare.com/docs/).

And another features like:

  * "venue_tips" add option to search tips from a venue who have some term, like pizza

  * "search_venues_by_tip" Search for venues by tip

  * "search_users_by_tip", search users by tip, 

  * "user_tips_by_text" Search all tips with some term for a given user.


## 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](https://github.com/intridea/oauth2) to retrieve and store oauth tokens for a user.  Obtain your client key/secret for userless access at the [foursquare developer site.](https://foursquare.com/oauth/)

### 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')


### Examples

See [the documentation](http://rubydoc.info/gems/foursquare2/frames) 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.checkin(:venueId => "4b2afcaaf964a5205bb324e3", :broadcast => 'public', :ll => '36.142064,-86.816086', :shout => 'zomg coffee!1!')



#### And some hacks to extends the api 

#### Search user by tip 

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

#### Search tips in a user ( or filter the tips of a user with some term)
     client.user_tips_by_text(:user_id => "123456", :query => 'coffee')

#### Search venues by tip 

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

#### Search tips in a venue ( or filter the tips of a venue with some term)

     client.venue_tips(:venueId => "4b2afcaaf964a5205bb324e3", :query => 'coffee')<commit_msg>Readme readability<commit_after># foursquare2

Ruby wrapper for the [foursquare v2 API](http://developer.foursquare.com/docs/).

## 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](https://github.com/intridea/oauth2) to retrieve and store oauth tokens for a user.  Obtain your client key/secret for userless access at the [foursquare developer site.](https://foursquare.com/oauth/)

### 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')


### Examples

See [the documentation](http://rubydoc.info/gems/foursquare2/frames) 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.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_by_text(:user_id => "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(:venueId => "4b2afcaaf964a5205bb324e3", :query => 'coffee')
{'fraction_non_alphanumeric': 0.12988560533841753, 'fraction_numerical': 0.055290753098188754, 'mean_word_length': 4.443579766536965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7091212', 'n_tokens_mistral': 1525, 'n_tokens_neox': 1342, 'n_words': 416}