Created
April 19, 2010 13:08
-
-
Save uehaj/371025 to your computer and use it in GitHub Desktop.
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
new GRubyScriptEngine().with { | |
require 'rubygems' | |
require 'mechanize' | |
def Mechanize = eval('WWW::Mechanize') | |
def a = Mechanize.new | |
a.basic_auth args[0], args[1] | |
def attachment_page = a.get('http://pukiwiki.example.com/pukiwiki.php?plugin=attach&pcmd=upload&page=sandbox') | |
def upload_form = attachment_page.form_with(method:"POST") | |
upload_form = upload_form | |
upload_form.pass = 'pass' | |
upload_form.file_uploads.first().file_name = args[2] | |
upload_form.submit | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment