import requests from eth_account import Account import uuid import time def 获取钱包地址(): account = Account.create() private_key = account.key.hex() address = account.address print("私钥:", private_key) print("地址:", address) return address def 查询积分(evm_address): import requests headers = { 'authority': 'beta.flock.io', 'accept': '*/*', 'accept-language': 'zh-CN,zh;q=0.9', 'cache-control': 'no-cache', # 'cookie': '_ga=GA1.1.1219633896.1709881452; _ga_SQVMRMN09Q=GS1.1.1709881451.1.1.1709881540.0.0.0; _ga_143MFGXNBR=GS1.1.1709881451.1.1.1709881540.0.0.0', 'pragma': 'no-cache', 'referer': 'https://beta.flock.io/points', 'sec-ch-ua': '"Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-origin', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36', } params = { 'wallet': evm_address, } response = requests.get('https://beta.flock.io/api/rag/getMyPoints', params=params, headers=headers) print(response.text) def 登录flock(evm_address): headers = { 'authority': 'beta.flock.io', 'accept': '*/*', 'accept-language': 'zh-CN,zh;q=0.9', 'authorization': 'Bearer 0xf33b436c47aa5719307583631f078c5b63e59fe7633f9e5e145612e84563e0df6c08ea9b0b8d7dabde5f7c8824abe1e9e6cd8504e6112dfc73cdaa7a31f58b8a1b', 'cache-control': 'no-cache', 'content-type': 'application/json', # 'cookie': '_ga=GA1.1.1219633896.1709881452; _ga_SQVMRMN09Q=GS1.1.1709881451.1.1.1709881540.0.0.0; _ga_143MFGXNBR=GS1.1.1709881451.1.1.1709881540.0.0.0', 'origin': 'https://beta.flock.io', 'pragma': 'no-cache', 'referer': 'https://beta.flock.io/points', 'sec-ch-ua': '"Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-origin', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36', } json_data = { 'auth_key': '1709881517685', 'wallet': evm_address, } response = requests.post('https://beta.flock.io/api/quest/login', headers=headers, json=json_data) def 领取每日连接钱包积分(evm_address): headers = { 'authority': 'api.particle.network', 'accept': '*/*', 'accept-language': 'zh-CN,zh;q=0.9', 'cache-control': 'no-cache', 'content-type': 'application/x-www-form-urlencoded', # 'cookie': '__cf_bm=BUswt75xfi_vii0jCViRPBWsAdXMb8Q2s_sH6v.rotw-1709881471-1.0.1.1-2fgZfyh4csdZg_pHc2vOmloDuLPbarYqHIbEApwBSVo1PNQkILD.EjH0rzlWsYbtxBgcs05UGXruV6loOfbOHQ', 'origin': 'https://beta.flock.io', 'pragma': 'no-cache', 'referer': 'https://beta.flock.io/', 'sec-ch-ua': '"Not A(Brand";v="99", "Google Chrome";v="121", "Chromium";v="121"', 'sec-ch-ua-mobile': '?0', 'sec-ch-ua-platform': '"macOS"', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'no-cors', 'sec-fetch-site': 'cross-site', 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36', } params = { 'timestamp': f'{int(time.time())}', 'random_str': str(uuid.uuid4()), 'project_app_uuid': '4db3a948-e4eb-416b-a813-e5ca0b5016d3', 'projectUuid': '5005dd4d-caeb-42ec-a09a-1566760a9121', 'projectKey': 'cwheS1n2R60wVRJ4rNx7n2URnAMQyIq9KwakM0TJ', } data = { 'chain_id': '534352', 'identity': evm_address, 'login_type': 'metamask', 'action': 'login', 'wallet_address': evm_address, } response = requests.post('https://api.particle.network/active', params=params, headers=headers, data=data) print(response.text) if __name__ == '__main__': evm_address = 获取钱包地址() 登录flock(evm_address) 领取每日连接钱包积分(evm_address) 查询积分(evm_address)
'''
私钥: 0x576b960a3b2d6c44c1ca04552571e27d6963f62cbd3c43138fbee0bc6a5edc56
地址: 0x8b2a33DAdE91f0f593a5f1150611bABDeaC1eCFE
{"success":true}
{"error":"User not found"}
{"id":"cltid3sl1004vz8406dqtbgse","userId":"cltid3skn004rz840yyeqwvdp","modelCreation":0,"contribution":0,"vote":0,"chat":0,"others":30,"totalRewardAmount":30,"createdAt":"2024-03-08T07:55:36.939Z","updatedAt":"2024-03-08T07:55:36.949Z"}
'''
标签:脚本,ch,evm,cache,sec,address,flock From: https://www.cnblogs.com/cuinima/p/18061188