Skip to content

Instantly share code, notes, and snippets.

@scpike
Created September 19, 2012 02:44
Show Gist options
  • Save scpike/3747358 to your computer and use it in GitHub Desktop.
Save scpike/3747358 to your computer and use it in GitHub Desktop.
Reply to a foursquare checkin
def create_reply(message)
reply_url = "https://api.foursquare.com/v2/checkins/#{checkin_id}/reply"
url = URI.parse(reply_url)
req = Net::HTTP::Post.new(url.path)
# token is a one time use secure random string
params = { :url => "http://www.hashtagmom.com/notify_mom/#{token}/",
:text => message,
:oauth_token => user.foursquare_access_token,
:v => "20120827" }
req.set_form_data(params)
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
response = http.request(req)
puts response
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment