Subversion Repositories SmartDukaan

Rev

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

Rev 16137 Rev 16139
Line 58... Line 58...
58
def downloadFile(cookie):
58
def downloadFile(cookie):
59
    headers['cookie'] = cookie
59
    headers['cookie'] = cookie
60
    url = "https://dial2verify.com/corp/control-panel/v2/Dial2Verify_UI_Data_export.php?type=excel2007&records=all&rndVal=0.1899"
60
    url = "https://dial2verify.com/corp/control-panel/v2/Dial2Verify_UI_Data_export.php?type=excel2007&records=all&rndVal=0.1899"
61
    req = urllib2.Request(url,headers=headers)
61
    req = urllib2.Request(url,headers=headers)
62
    res = urllib2.urlopen(req)
62
    res = urllib2.urlopen(req)
63
    filePath = "/tmp/dia2verify"+str(datetime.datetime.now())+".xlsx"
63
    filePath = "/tmp/dial2verify"+str(datetime.datetime.now())+".xlsx"
64
    output = open(filePath,'wb')
64
    output = open(filePath,'wb')
65
    output.write(res.read())
65
    output.write(res.read())
66
    output.close()
66
    output.close()
67
    return filePath
67
    return filePath
68
 
68
 
69
def main():
69
def main():
70
    cookie = run()
70
    cookie = run()
71
    return downloadFile(cookie)
71
    return downloadFile(cookie)
72
    
-
 
73
    
-
 
74
 
72
 
75
if __name__ == '__main__':
73
if __name__ == '__main__':
76
    main()
74
    main()
77
    
75
    
78
76