IRCTC Beta Availability
Sign in

IRCTC Beta Availability

Software Engineer
Hi all,

This post is basically related to the IRCTC site that we guys in India use.

I have already blogged about this @ http://n-k-c-v.blogspot.com/2010/02/irctc-beta-availability-in-one-shot.html. But thought of adding the same blog here too.


I use IRCTC virtually every week to book my train tickets and i must say that i've found it to be on the slower side somewhat. But i guess they do an OK job considering the number of people using it.

One feature which i think would make our lives easier while using IRCTC, is if we had the availability of all the trains shown one go, rather than going and picking each one by one.

So i went about trying to see if i could add this feature myself to the IRCTC UI. And that's when i stumbled upon something called GreaseMonkey which is basically a FireFox add-on. What this let's me do is embed HTML code into any website using something called userscripts. Userscripts are nothing but good old JavaScript code, which is one of my favourite flavours.

IRCTC recently released their new Beta site which has a nicer and cleaner UI than it's predecessor. I went ahead and created a userscript for the Beta site, which would get me the availability of the trains listed. All that was left was to create an extra TD(column) there and then embed the availability status in that.

Now initially i did try this for the normal IRCTC site but the site is very badly well formed. As a result i couldn't parse the HTML response that i got. Not sure why they can't do simple things like closing a DIV tag that was opened etc...

So guys, to have this feature do the following things:

  • First install the GreaseMonkey add-on for FireFox from https://addons.mozilla.org/en-US/firefox/addon/748. Make sure you restart your FireFox after installing this.
  • After restarting FireFox, you'll see a smiling monkey icon in the bottom right hand corner.
  • Next you'll need to install the userscript which i've created. Go to http://userscripts.org/scripts/show/68115 which is the page of my userscript.
  • There you'll see an green install button which you'll have to click. This would open up a pop-up asking for confirmation to install. Just click on Install button in the pop-up to install.
  • All you have to do now, is go to the IRCTC beta site @ http://www.irctc.co.in/cgi-bin/beta.dll/irctc/services/home.do and login there.
  • In the Plan My Travel box, just give in the details and click the Find Trains button.
  • You'll notice that an extra column in added showing the availability status for each of the trains.

I find this extremely useful when booking Tatkal tickets where every second counts.
Right now it shows only the availability for the Sleeper(SL) coach. If you guys have any suggestions/comment please do let me know. You can either comment in the userscript home page or post it here itself. I've opened this up as an open source project @http://code.google.com/p/irctcbeta-availability-greasemonkey-script/. If anyone is interested in contributing to this, like adding new features etc... please do join up in the above link.

I've uploaded sample screen shot of this @ http://1.bp.blogspot.com/_8gFbCM4eSXw/S22t9lM_6wI/AAAAAAAAAQg/7yhaxr0Iph4/s400/irctcbeta_GMScript.png

-Nitin

start_blog_img