Subversion Repositories SmartDukaan

Rev

Rev 11993 | Rev 11995 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11993 Rev 11994
Line 53... Line 53...
53
 
53
 
54
listRechargeType = ['top_up','special_recharge','2g_data','3g_data']
54
listRechargeType = ['top_up','special_recharge','2g_data','3g_data']
55
 
55
 
56
def fetch_plans(operator,circle,rechargeType):
56
def fetch_plans(operator,circle,rechargeType):
57
    url='https://hub.paytm.com/api/plans/list?type=mobile&operator=%s&circle=%s&category=%s&auth=nosession&callback=jQuery15203827297973902207_1374842060208'%(operator[1],circle[1],rechargeType)
57
    url='https://hub.paytm.com/api/plans/list?type=mobile&operator=%s&circle=%s&category=%s&auth=nosession&callback=jQuery15203827297973902207_1374842060208'%(operator[1],circle[1],rechargeType)
-
 
58
    print url
58
    time.sleep(2)
59
    time.sleep(2)
59
    req = urllib2.Request(url)
60
    req = urllib2.Request(url)
60
    response = urllib2.urlopen(req)
61
    response = urllib2.urlopen(req)
61
    json_input = response.read()
62
    json_input = response.read()
62
    start = json_input.rindex("\"plans\":") + len( "\"plans\":" )
63
    start = json_input.rindex("\"plans\":") + len( "\"plans\":" )