forked from cmdrkeene/foursquare
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
99 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
Until further notice: Copyright 2009 Brandon Keene - All Rights Reserved | ||
Copyright (c) 2009 Brandon Keene | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,104 @@ | ||
# A Ruby API for Foursquare (playfoursquare.com) | ||
Foursquare | ||
========== | ||
|
||
This is a thin interface to Foursquare's JSON API. You can find full documents | ||
here: http://groups.google.com/group/foursquare-api/web/api-documentation | ||
A ruby interface for Foursquare's JSON API. | ||
|
||
## Actions | ||
Based on Foursquare API Documentation: | ||
http://groups.google.com/group/foursquare-api/web/api-documentation | ||
|
||
* **checkin** - check into a venue | ||
* **cities** - listing of active cities | ||
* **venues** - search for venues | ||
|
||
## Usage | ||
Install | ||
------- | ||
|
||
### checkin | ||
$ gem sources -a http://gems.github.com | ||
$ sudo gem install cmdrkeene-foursquare | ||
|
||
This is how you check into a venue: | ||
Usage | ||
----- | ||
|
||
### _checkin_ - Allows you to check-in to a place. | ||
|
||
First, create a new Foursquare instance with your Basic Authentication | ||
credentials: | ||
|
||
@foursquare = Foursquare.new("user@example.com", "sekret") | ||
|
||
Then, you can check in with a venue id (vid): | ||
|
||
@foursquare.checkin(:vid => 1234) # => A specific venue id | ||
@foursquare.checkin(:venue => "Mamoun's") # => A name search for venue | ||
|
||
Or you can check in with a name search for a venue: | ||
|
||
If successful, you will get a response hash with the following keys: | ||
@foursquare.checkin(:venue => "Mamoun's") | ||
|
||
#### ID | ||
If successful, you will get a response hash with the following keys: | ||
|
||
"id" => 701707 | ||
* #### ID | ||
|
||
#### Message | ||
"id" => 701707 | ||
|
||
"message" => "OK! We've got you @ Santana's Bay Park." | ||
* #### Message | ||
|
||
#### Created | ||
"message" => "OK! We've got you @ Santana's Bay Park." | ||
|
||
"created" => "Tue, 11 Aug 09 16:02:13 +0000" | ||
* #### Created | ||
|
||
"created" => "Tue, 11 Aug 09 16:02:13 +0000" | ||
|
||
#### Mayor | ||
|
||
"mayor" => { | ||
"type" => "nochange", | ||
"message" => "Casey W. is The Mayor of Santana's Bay Park." | ||
} | ||
* #### Mayor | ||
|
||
#### Scoring | ||
"mayor" => { | ||
"type" => "nochange", | ||
"message" => "Casey W. is The Mayor of Santana's Bay Park." | ||
} | ||
|
||
"scoring" => { | ||
"score" => { | ||
"icon" => "http://playfoursquare.com/images/scoring/2.png", | ||
"points" => 1, | ||
"message" => "First stop today" | ||
}, | ||
"total" => { | ||
"points" => 6, | ||
"message" => "6 pts " | ||
}, | ||
"rank" => { | ||
"city" => { | ||
"city" => "San Diego", | ||
"position" => 42, | ||
"message" => "#42 in San Diego (this week)" | ||
}, | ||
"friends" => { | ||
"position" => 1, | ||
"message" => "#1 amongst friends" | ||
* #### Scoring | ||
|
||
"scoring" => { | ||
"score" => { | ||
"icon" => "http://playfoursquare.com/images/scoring/2.png", | ||
"points" => 1, | ||
"message" => "First stop today" | ||
}, | ||
"total" => { | ||
"points" => 6, | ||
"message" => "6 pts " | ||
}, | ||
"rank" => { | ||
"city" => { | ||
"city" => "San Diego", | ||
"position" => 42, | ||
"message" => "#42 in San Diego (this week)" | ||
}, | ||
"friends" => { | ||
"position" => 1, | ||
"message" => "#1 amongst friends" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#### Badges | ||
* #### Badges | ||
|
||
"badges" => { | ||
"badge" => { | ||
"name" => "Newbie", | ||
"text" => "Congrats on your first check-in!", | ||
"icon" => "http://playfoursquare.com/images/badges/newbie_on.png", | ||
"id" => 54494 | ||
} | ||
} | ||
"badges" => { | ||
"badge" => { | ||
"name" => "Newbie", | ||
"text" => "Congrats on your first check-in!", | ||
"icon" => "http://playfoursquare.com/images/badges/newbie_on.png", | ||
"id" => 54494 | ||
} | ||
} | ||
|
||
#### Venue | ||
|
||
"venue" => { | ||
"city" => "San Diego", | ||
"address" => "1975 Morena Blvd.", | ||
"name" => "Santana's Bay Park", | ||
"zip" => 92110, | ||
"geolong" => -117.207, | ||
"geolat" => 32.782, | ||
"crossstreet" => nil, | ||
"id" => 84689, | ||
"cityid" => 38, | ||
"state" => "CA" | ||
} | ||
* #### Venue | ||
|
||
### cities | ||
"venue" => { | ||
"city" => "San Diego", | ||
"address" => "1975 Morena Blvd.", | ||
"name" => "Santana's Bay Park", | ||
"zip" => 92110, | ||
"geolong" => -117.207, | ||
"geolat" => 32.782, | ||
"crossstreet" => nil, | ||
"id" => 84689, | ||
"cityid" => 38, | ||
"state" => "CA" | ||
} |