Skip to content

Instantly share code, notes, and snippets.

@therabidbanana
Created April 6, 2011 21:36
Show Gist options
  • Save therabidbanana/906588 to your computer and use it in GitHub Desktop.
Save therabidbanana/906588 to your computer and use it in GitHub Desktop.
A Simple HTTP script to automate finding grid spaces. (For http://therabidbanana.github.com/apiwars)
# this script's occupy method didn't work very well. HTTParty isn't good at PUTs.
#
# Try rest-client gem instead:
#
#
# $ gem install rest-client
# $ restclient 'http://apiwars.heroku.com'
# > get '/grid/123', {:params => {:api => '...', :pin => '2222'}}
# ---> {...}
# > put '/grid/123', {:api => '...', :pin => '...', :unit => 'testunit'}
# ---> 201 successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment