cronable voting script View next topic
View previous topic
Post new topicReply to topic
Author Message
apog
Supporting Member 2009

Posts: 95

View user's profile
PostPosted: Tue Aug 30, 2005 21:44 pm Reply with quoteBack to top

Edit: Updated to work as of Jan 6th 2008

Also, this version has a few more greps as I have to keep grep'ing until I get to the specific values I want. If you know a better way to get specific subsets of matches in a bash script, then please post it.


someone somewhere over the rainbow asked for a cronable voting script. I just wanted to see if I could do it and here is my crappy version.

Please note that each of the commands should be on one line, they shouldn't be split in to two lines like they are here. If there is a full line break then that signifies two seperate lines. If there is two lines with no space between, then those should be on one line. You must have version 1.9.1 or higher of wget or else the --post-data option isn't available. This could also be turned into a neater looking perl script.


Code:

#/bin/sh

wget -O ~/rank.html http://www.topmudsites.com/cgi-bin/topmuds/rankem.cgi?id=idles

ssid1=`grep -io '"ssid1" value=".*"' ~/rank.html | grep -io 'value=".*"' | grep -io '".*"' | grep -io '[a-zA-Z0-9]\+'`

mudid=`grep -io '"mudid" value=".*"' ~/rank.html | grep -io '[0-9]\+'`

do=`grep -io '"do" value=".*"' ~/rank.html | grep -io 'value=".*"' | grep -io '".*"' | grep -io '[a-zA-Z]\+'`

submit=`grep -io '"submit" value=".*"' ~/rank.html | grep -io 'value=".*"' | grep -io '".*"' | grep -io '[a-zA-Z]\+'`

rm rank.html

wget -O ~/answer.html --post-data=\"mudid=$mudid\&ssid1=$ssid1\&do=$do\&submit=$submit\" http://www.topmudsites.com/vote.php



Last edited by apog on Mon Jan 07, 2008 00:51 am; edited 3 times in total
haeggar
Supporting Member 2008

Posts: 19

View user's profile
PostPosted: Thu Sep 01, 2005 11:14 am Reply with quoteBack to top

installed the script on the development and the staging server - thumps up Twisted Evil
apog
Supporting Member 2009

Posts: 95

View user's profile
PostPosted: Tue Mar 14, 2006 08:43 am Reply with quoteBack to top

It's that time again, seems like Xerene is trying extra hard to get us all to vote. The script above works for all you linux gurus, but I know some people out there are Windows users and so I've got a simple VBScript that you can install that will allow you to vote merely by double clicking.

Steps to install.

1.) Create a new text file on your desktop. (right-click on the desktop, then choose, new -> text document).
2.) Rename the file to icesus.vbs
3.) Edit the file using notepad.
4.) Copy and paste the text below into notepad.
5.) Save the file
6.) Double click the file.

It should take several seconds where you will see the TMS page. Then once it is complete, you will see a message box that says "Vote Sent". Click on OK and the IE window will be closed.

Basically what this script does is open an Internet Explorer script, navigate to the vote page, and simulate clicking on the link to vote.

Code:

option explicit

'declare our constants
CONST URL = "http://www.topmudsites.com/cgi-bin/topmuds/rankem.cgi?id=idles"
CONST SLEEPTIME = 10
CONST READYSTATECOMPLETED = 4


'Create an IE object and use it to cut down on
'the work required to parse out our variables.
With CreateObject("InternetExplorer.Application")
  .visible = true
  .Navigate URL
 
  'sleep for SLEEPTIME milliseconds and check
  'to see if the page is fully loaded.
  Do Until .ReadyState = READYSTATECOMPLETED
    Wscript.sleep SLEEPTIME
  Loop
   
  'Progmatically submit the form.
  .document.click.submit()

  'Sleep for half a second.  Since the form
  'submit is asynchronous, the script needs
  'to give the IE object some time to start
  'the request before the ready state is
  'checked.  If the script doesn't wait
  'it will be checking the ready state before
  'the IE object has a chance to even start
  'the form submit.
  Wscript.sleep 500

  'sleep for SLEEPTIME milliseconds and check
  'to see if the page is fully loaded.
  Do Until .ReadyState = READYSTATECOMPLETED
    Wscript.sleep SLEEPTIME
  Loop

  'close up the IE object
  .Quit

End With

wscript.echo "Vote Sent"


If you ask really nice, Haeggar or some other nice soul, might peer review this and then post it on a public website so you can just download it and don't have to go through all those install steps. However, if you download it, open it with notepad first to insure it has not been modified to do something dangerous.

I only have access to an en-us keyboard and OS and so I can't guarantee that this will work on foreign computers. If it doesn't, I apologize, but there isn't much I can do about that.

Edit: Added .visibility = true (which was an original request of TMS, but apparently only got added to my local copy.)


Last edited by apog on Mon Jan 07, 2008 00:56 am; edited 2 times in total
apog
Supporting Member 2009

Posts: 95

View user's profile
PostPosted: Tue Mar 14, 2006 09:00 am Reply with quoteBack to top

Please do not set to this automatically run in any way as TMS could take Icesus off the list completely for that. This is only to help you vote when you remember or want to.

Edit: Took out old recomendation (again, was requested by TMS but I apparently forgot to update my post)


Last edited by apog on Mon Jan 07, 2008 00:24 am; edited 1 time in total
haeggar
Supporting Member 2008

Posts: 19

View user's profile
PostPosted: Thu Mar 16, 2006 22:22 pm Reply with quoteBack to top

download at

http://haeggar.techzone.at/icesus/vote.vbs

and its tested with DE-keyboard too.
croli


Posts: 17
Location: Tromsø, Norway

View user's profile
PostPosted: Mon Jan 07, 2008 01:32 am Reply with quoteBack to top

apog wrote:
Edit: Updated to work as of Jan 6th 2008

Also, this version has a few more greps as I have to keep grep'ing until I get to the specific values I want. If you know a better way to get specific subsets of matches in a bash script, then please post it.



I reduced the grep-orgy you wrote there to quite a lot less, but at a price. Now it will break horribly whenever something unexpected comes from TMS Wink

The lines now read something like this:
Code:

ssid1=`grep -i ssid1 ~/rank.html | cut -f6 -d'"'`
mudid=`grep -i mudid ~/rank.html | cut -f6 -d'"'`
do=`grep -i "name.*do" ~/rank.html | cut -f6 -d'"'`
submit=`grep -i "name.*submit" ~/rank.html | cut -f6 -d'"'`


Oh, and this has the added benefit not to depend on GNU grep 2.5.x any more, since we don't need the -o flag anymore.
ity


Posts: 50
Location: U.S.A

View user's profile
PostPosted: Thu Feb 20, 2014 13:20 pm Reply with quoteBack to top

Anyway to make something like this for Android os so I can click a link on my phone to vote?
terces


Posts: 12

View user's profile
PostPosted: Mon Dec 14, 2015 09:55 am Reply with quoteBack to top

Not recommended to do automated scripts. They can get Icesus banned and that is the opposite what we try to achieve by voting.

++ Terces
Display posts from previous:      
Post new topicReply to topic
View next topic
View previous topic

Navigation


Powered by phpBB | All times are GMT