Command Line Browsing with Trace output script log


One of the first problems I will experience with my no computer for 20 days is that I will not be able to check my grades for my courses. My last day of finals is today and the grades won’t be all up until Thursday or later. My solution? Well, this might be cheating, but I think it’s quite clever.

I need a way to check my DPR for my grades. Unfortunately, Case has implemented a portal system using some bastardized Oracle system that has horrible HTML output that a mastermind using curl, a command line HTML agent, would spend days implementing.

Luckily, I noticed lynx, a command line text web browser, has a very fancy and handy feature: –cmd_log=file and –cmd_script=file

Simply load up the URL with the –cmd_log=filename and it creates a log file of every action you do! It works beautifully even against some very harsh password protected signins and crazy unsigned certificates.

Here is what I did:

lynx –cmd_log=mylog my.case.edu

During this scripted session, I had it navigate its way over to my dpr (I logged in, and then manually told it a URL to go to since it couldn’t follow the javascript button). I then Printed the page to a file.

Then, I tested it again using the script file I created:
lynx –cmd_script=mylog my.case.edu

It whizzes through all the motions again and downloads my full grade report! Awesome!

I then wrote a bash script to search for my classes using grep. Grabbed the grades using awk. Emailed the grades to my cellphone via sendmail and my cellphone’s email address. I set this action to occur each day at midnight. I then created another script to remove the previous script from cron. I scheduled that script to run at the end of the month.

Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Other Posts
Signing Off - see you in 20 days
20 Days Without a PC

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!