foursquare

A simple Ruby Gem wrapper for the Foursquare API.

install

gem install foursquare

example

require ‘rubygems’ require ‘foursquare’

# foursquare's site uses email as the user name

fq = Foursquare.new(‘username_or_phone’,‘password’)

fq.test

fq.venues(geolat, geolong, :limit=>10,:q=>‘pizza’) fq.tips(geolat,geolong,:limit=>10) fq.checkins(:geolat=>”,:geolong=>”) fq.checkin(vid,venue,shout,:private=>0,:twitter=>0,:facebook=>1,:geolat=>‘12.03’,:geolong=>‘-123:private=>0,:twitter=>0,:facebook=>1,:geolat=>‘12.03’,:geolong=>‘-123.33’) fq.history(:limit=>10) fq.user_details(user_id,:badges=>0,:mayor=>0) fq.friends(:uid=>99999) fq.venue_details(venue_id) fq.add_venue(name,address,cross_street,city,state,options) fq.propose_edit(venue_id,name,address,cross_street,city,state,options) fq.flag_venue_as_closed(venue_id) fq.add_tip(venue_id,text,:type=type) fq.mark_tip_as_todo(tid) fq.mark_tip_as_done(tid) fq.friend_requests fq.friend_approve(uid) fq.friend_deny(uid) fq.request_friend(uid) fq.find_friends_by_name(‘Bugs Bunny’) fq.find_friends_by_phone(‘8675309’) fq.find_friends_by_twitter(‘github’) fq.set_pings(‘self’,‘goodnight’)

# Foursquare is moving the API to geolat/geolong and removing the concept of cities

fq.cities fq.check_city(geolat, geolong) fq.switch_city(city_id) fq.friend_checkins(:geolat=>”,:geolong=>”)

license

(the MIT license)

Copyright © 2009 Workperch Inc

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.