Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- #
- import json
- import sqlite3
- import requests
- #
- import sqlite3
- config = {}
- con = sqlite3.connect("/home/azureuser/clever/clever.db")
- cur = con.cursor()
- email = input("Please enter your email address that is registered with clever...> ")
- # Read config from DB
- r = cur.execute("SELECT * from Config")
- for x,y in r.fetchall():
- config[x]=y
- url = 'https://mobileapp-backend.clever.dk//api/mobile/customer/verifyEmail?email='+email
- headers = {'content-type': 'application/json',
- 'accept': '*/*',
- 'authorization': 'Basic bW9iaWxlYXBwOmFwaWtleQ==',
- 'app-version': '2.8.0',
- 'app-os': '15.7',
- 'app-platform': 'iOS',
- 'app-device': 'iPhone9,3',
- 'accept-encoding': 'gzip, deflate, br',
- 'accept-language': 'da-DK,da;q=0.9',
- }
- r = requests.get(url,headers=headers)
- # print(r.json())
- secretCode = input("Please enter the secretCode from the URL you have just recieved from clever...> ")
- config['email'] = email
- config['secretCode'] = secretCode
- url='https://mobileapp-backend.clever.dk/api/mobile/customer/verifySignupToken?token='+config['secretCode']+'&email='+config['email']
- headers = {'content-type': 'application/json',
- 'accept': '*/*',
- 'authorization': 'Basic bW9iaWxlYXBwOmFwaWtleQ==',
- 'app-version': '2.8.0',
- 'app-os': '15.7',
- 'app-platform': 'iOS',
- 'app-device': 'iPhone9,3',
- 'accept-encoding': 'gzip, deflate, br',
- 'accept-language': 'da-DK,da;q=0.9',
- }
- r = requests.get(url,headers=headers)
- print(r.json())
- url = 'https://mobileapp-backend.clever.dk/api//v2/customer/registerProfile'
- data = {"email": config['email'],
- "firstName": r.json()['data']['firstName'],
- "lastName": r.json()['data']['lastName'],
- "token": config['secretCode']
- }
- p = requests.post(url,json=data,headers=headers)
- # print(p.json())
- # print('---')
- print("userSecret='"+p.json()['data']['userSecret']+"'")
- config['userSecret'] = p.json()['data']['userSecret']
- # Write config to DB
- print("Writing config...")
- for x in config:
- sql = "UPDATE Config SET value = '"+config[x]+"' WHERE var = '"+x+"';"
- print(" "+sql)
- cur.execute(sql)
- con.commit()
- con.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement