MUDII Forums
[
Edit Profile
] [
Edit Your Preferences
] [
Search
]
[
Private Messages
] [
Memberslist
] [
FAQ
] [
Login
]
About Posting
All
Registered
users can post new topics and replies to this forum
Username:
Password:
Message Body:
HTML is: Off
BBcode is: On
[quote] On 22-09-2010 19:46, Havoc wrote: I think this script works. You need Java 1.5 SDK and Groovy 1.7.5 for it work. So this is probably only for the technically inclinded: @Grab(group='htmlunit', module='htmlunit', version='1.13') import com.gargoylesoftware.htmlunit.* import com.gargoylesoftware.htmlunit.html.* println "Voting..." println() println() WebClient webClient = new WebClient() webClient.setRedirectEnabled(true) HtmlPage page = webClient.getPage("http://www.topmudsites.com/vote-karya.html") HtmlForm form = page.getForms()[0] HtmlSubmitInput button = form.childElementsIterator.find { it instanceof HtmlNoScript }. childElementsIterator.find { it instanceof HtmlSubmitInput } HtmlPage page2 = button.click() println() println() println "Vote done" The first time will take a while as it needs to download HtmlUnit. Normal output is: $ groovy autovote.groovy Voting... Sep 22, 2010 11:44:23 AM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded INFO: Redirect requested but followRedirects is disabled Sep 22, 2010 11:44:23 AM com.gargoylesoftware.htmlunit.html.HtmlPage loadJavaScriptFromUrl WARNING: Expected content type of text/javascript or application/x-javascript for remotely loaded javascript element http://www.topmudsites.com/cgi-bin/mikey/mikey.pl?js=1 but got [text/html] Vote done [/quote]
Options:
Disable
BBcode
on this Post
Disable
Smilies
on this Post
Show signature
(This can be altered or added in your profile)
Topic Review
These forums may be read by anyone, but only registered mudII.co.uk
players may post. When posting, please refrain from behaviour
not tolerated in the game.
These forums are moderated.
Powered by
phpBB
Copyright © 2000 - 2001
The phpBB Group
phpBB Created this page in 0.001581 seconds.