Skip to content

Instantly share code, notes, and snippets.

@scpike
Created September 19, 2012 02:41
Show Gist options
  • Save scpike/3747348 to your computer and use it in GitHub Desktop.
Save scpike/3747348 to your computer and use it in GitHub Desktop.
Add a post to a foursquare checkin
def create_post
url = URI.parse("https://api.foursquare.com/v2/checkins/#{checkin_id}/addpost")
req = Net::HTTP::Post.new(url.path)
params = { :url => "http://www.hashtagmom.com",
: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)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment