Reliance Wireless broadband auto-login (and logout) script(s)

The old “curl” based method stopped working yesterday when Reliance got a new login page as well as a new backend. It seems Reliance is now also looking at Cookies during authentication. Here’s a little Python script that you can execute to automate the process.

If you don’t know what Python is, you better stick to browser based authentication 🙂

Needless to say, you can schedule this script as a cron/ launchd job to run periodically and keep you logged in. That’s how I use it, which is why the script doesn’t output anything to prevent unnecessary log “pollution”.

Login Script for Python 2.x

#!/usr/bin/env python
# encoding: utf-8
"""
Reliance Login Script for Python 2.x v1.0

Created by Kunal Dua on 2009-12-18
Reliance Wireless broadband auto-login (and logout) script(s)
This program is free software; you may redistribute it and/or modify it under the same terms as Python itself. """ import urllib2, urllib, cookielib username = '1111111111111111' #replace the text within quotes with your username password = 'password' #replace the text within quotes with your password jar = cookielib.FileCookieJar("cookies") opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar)) response = opener.open("http://10.239.89.15/reliance/startportal_isg.do") login_data = urllib.urlencode({'userId' : username, 'password' : password, 'action' : 'doLoginSubmit'}) resp = opener.open('http://10.239.89.15/reliance/login.do', login_data)

Update: Logout Script for Python 2.x

#!/usr/bin/env python
# encoding: utf-8
"""
Reliance Logout Script v1.0

Created by Kunal Dua on 2009-12-22
http://www.kunaldua.com/blog/?p=323

This program is free software; you may redistribute it and/or
modify it under the same terms as Python itself.
"""

import urllib2, cookielib

jar = cookielib.FileCookieJar("cookies")
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(jar))

response = opener.open("http://10.239.89.15/reliance/login.do", timeout=2)

resp = opener.open('http://10.239.89.15/reliance/logout.do')

Update: Login Script for Python 3.x

#!/usr/bin/env python
# encoding: utf-8
"""
Reliance Login Script for Python 3.0 v1.0

Created by Kunal Dua on 2009-12-30
http://www.kunaldua.com/blog/?p=323

This program is free software; you may redistribute it and/or
modify it under the same terms as Python itself.
"""

import urllib, http.cookiejar

username = '1111111111111111' #replace the text within quotes with your username
password = 'password'	#replace the text within quotes with your password

jar = http.cookiejar.FileCookieJar("cookies")
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(jar))

response = opener.open("http://10.239.89.15/reliance/startportal_isg.do")

login_data = urllib.parse.urlencode({'userId' : username, 'password' : password, 'action' : 'doLoginSubmit'})
resp = opener.open('http://10.239.89.15/reliance/login.do', login_data)

Bad Bad Twitter

Since a few asked – I am moving from @duak to @kunaldua since Twitter refuses to index the former. What difference does it make? A lot!

  • I don’t appear in People Search. By itself, probably not a big deal and something I could have lived with. But not when you include the next 3.
  • If I “mention” anyone (@twitter_id) in one of my tweets, they’ll never see that tweet in their list of mentions unless they follow me.
  • Even if you are following me, unless I start my tweet with @yourtwitterid, you won’t see that tweet in your list of mentions.
  • My tweets don’t appear in any search results, so if I participate in any conferences/ events and use hash-tags and the likes, no one sees it!

So that’s it – there’s the reason for the switch. Probably Twitter thinks I am a spammer so they decided to block me and unfortunately there’s no way for me to get this addressed in any other way. See you @kunaldua.

Announcing Iglooo – Find books. Compare prices. Buy.

Pleased to announce Iglooo, a site that’ll help you find the best deals on books online. Targeted at the Indian audience, it consolidates the results from multiple online book stores and presents them in a visually appealing, yet clutter free format. That’s about it.

Give Iglooo a whirl and let me know what you think!