Created
January 2, 2014 18:31
-
-
Save mikeymckay/8224041 to your computer and use it in GitHub Desktop.
Ruby script to post to any google form (no login required).
This file contains 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
#!/usr/bin/env ruby | |
# usage: | |
# post.rb <live_form_url> arg1 arg2 arg3 ... | |
require "rest-client" | |
live_form_url = ARGV.shift | |
post_form_url = live_form_url.gsub(/viewform/,"formResponse") | |
params = RestClient.get(live_form_url).scan(/(entry\.\d+)/).flatten | |
options = {} | |
params.each do |param| | |
options[param] = ARGV.shift | |
end | |
RestClient.post post_form_url, options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment