Created
January 31, 2012 15:59
-
-
Save scpike/1711300 to your computer and use it in GitHub Desktop.
Pull foursquare checkins
This file contains hidden or 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
def get_checkins() | |
foursquare_client = get_foursquare_client() | |
foursquare_client.user_checkins[:items].each do |checkin| | |
# Check if checkin already stored for de-dup purposes | |
next if Checkin.find( :first, :conditions => { :checkin_id => checkin.id }) | |
c = Checkin.new(:user => self, :action => action) | |
c.set_checkin_data(checkin) | |
c.save() | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment