Advice for program with network/automation/authentication purpose
I have an idea for a program that will do a particular job for me; a job which I keep forgetting to do. I am looking for some advice on how to get started with it, i.e. language recommendations that will allow me to complete the program.
The chore is as follows:
I open up a web browser, visit the web page, log in, click a tab in my account and "sign on", log out, close browser.
Due to having so much on at the moment with work I forget about this and it is important that I do it before a particular time in the morning.
Aside from alleviating me of the chore, I am keen to learn about the software technologies that wil开发者_StackOverflowl allow me to automate this and work on my novice programming skills some more.
The way I perceive this of working would be:
Write program that runs as a daemon, checks date and time every 30 minutes (to "sign on" half an hour before deadline), either calls another program or methods/functions within its own programming that opens up a socket, port and IP before deadline, automates text entry of username and password fields within the HTML of log-in page's source, automate/action the Javascript "submit" button, accept/store cookie, action the appropriate radio button's associated Javascript function for "sign on", action "log off" Javascript function, nullify cookie/session, end.
I am, unfortunately for me, a little hazy in the technical aspects that this would involve. I run Linux so perhaps the daemon will be a cron job, and the actual main bulk of the program would be methods/functions called up at the appropriate time before the deadline?
Is this better accomplished in Ruby, Perl, Python or Java? Or Perhaps the cron-job associated with a simple script that calls a Java program? I apologise but I am a little naive here as software isn't my subject so some advice would be greatly appreciated. So too would be if you could point me in the direction of the right resources to read as well.
I am aware of Ruby's Mechanize library, but I am only familiar with Java. However, willing to pick up another language.
This sounds like something that, depending on the structure of their website, could easily be handled by curl.
man page: http://linux.die.net/man/1/curl
In essence, you can write a cron job that calls a little bash script. Your bash script will just be a couple curl statements that log you on and request the "sign on" page.
精彩评论