Whenever I have to accomplish something these days (in terms of programming that is), the language that I turn to at first is Google Script. I have gotten so used to it, and its interface that I prefer it over any other language, or services. The added bonus of using it is that you can run the script regularly by setting up a timer. No need to meddle with cronjobs and what-not on your server.

Some time back, I was trying to login to my college’s LMS (Learning Management System) using Google Script. My college uses Moodle and it has been setup such that if you do not login for 12 consecutive days, your account will get disabled. Once disabled, you need to go to the authority and bend over your backwards to convince him to re-active your account. I don’t login to Moodle very often and neither do my friends. I turned to Google Script to solve this problem, to login to Moodle every week.

You can use the following script to login to any (I hope) website via Google Script.

See the logger to know whether your login was successful. Obviously, you need to replace “enter your username” et cetera with your username and so on. Read the comments as well. Though the code is simple, I got stuck in the cookie part. I was using cookie[0] and it would not redirect me to the next page. So, keep that in mind.

Good luck and do subscribe below.