Tuesday, July 26, 2011

Reliance broadband login script - 2011

This is a script which can be run as a cronjob to login to Reliance connection automatically.

You can get the code here http://sprunge.us/eMLG

#!/usr/bin/python2

__author__ = """
NAME: Abhijeet Rastogi (shadyabhi)
Profile: http://www.google.com/profiles/abhijeet.1989
"""

import cookielib
import urllib2
from getpass import getpass


#Enter your username & password here.
username = "myuser"
password = "secert"

#Logging into the SMS Site
url = 'http://reliancebroadband.co.in/reliance/login.do'

#Remember, Cookies are to be handled
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

# To fool way2sms as if a Web browser is visiting the site
opener.addheaders = [('User-Agent','Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20091020 Ubuntu/9.10 (karmic) Firefox/3.5.3 GTB7.0')]
try:
    #For sake of taking cookies which will be sent in second request
    usock = opener.open(url)
except IOError:
    print "Check your ethernet cable"
    sys.exit(1)

#Sending login request
request_url = 'http://reliancebroadband.co.in/reliance/login.do?action=doLoginSubmit'
request_data = 'userId='+username+'&password='+password
opener.addheaders = [('Referer','http://reliancebroadband.co.in/reliance/login.do?action=doLoginSubmit')]

try:
    sms_sent_page = opener.open(request_url,request_data)
except IOError:
    print "Oops, reliance connection taking too much time to respond. Try again."
    sys.exit(1)

10 comments:

  1. wow...... it's great
    we also provide Airtel broadband

    ReplyDelete
  2. Its is very useful script Thanks...........

    we also provideAirtel broadband

    ReplyDelete
  3. Here is different Reliance plans  for Broadband users
    We also provide Reliance Broadband

    ReplyDelete
  4. hey bro.. how to run this script?

    ReplyDelete
  5. Download python from here. http://www.python.org/download/releases/2.7.3

    After installation, copy-paste the code given above & save it in a file named reliance.py. After that, simply double click it.

    ReplyDelete
  6. thanks bro. will give a try and get back to u

    ReplyDelete
  7. yep, it is working great. now i have to make "reliance.py" to auto run  at system start up.
    is there any code to add this script to make it auto run at system start up.
    thanks in advance.

    ReplyDelete
  8. Search on google for autostarting apps. The way I have configured it, I have added it as a dispather script in networkmanager so as soon as an interface goes up, the script is executed. You can search for the windows alternative for the same.

    ReplyDelete
  9. i m all ready using "turbo launch" but it is used 10 mbs of memory at start up while its launch reliance.py file. that's y i have told u for some coding to add script.
    any way big thanks bro for ur script. now i can auto login at system start up and i m enjoying truly unlimted broad band from reliance.
    thanks and good day

    ReplyDelete