Skip to content

Instantly share code, notes, and snippets.

@scpike
Created January 31, 2012 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scpike/1711300 to your computer and use it in GitHub Desktop.
Save scpike/1711300 to your computer and use it in GitHub Desktop.
Pull foursquare checkins
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