|
|
@@ -0,0 +1,40 @@
|
|
|
+import time
|
|
|
+from datetime import datetime
|
|
|
+import httpx
|
|
|
+
|
|
|
+url = "https://api.chainalert.me/"
|
|
|
+headers = {
|
|
|
+ "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
|
|
+ "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
|
|
|
+}
|
|
|
+
|
|
|
+for page in range(1, 11):
|
|
|
+ payload = {
|
|
|
+ "method": "listData",
|
|
|
+ "params": ['', "CRYPTO_RANK_AIRDROP", page, 0, 0, '']
|
|
|
+ }
|
|
|
+
|
|
|
+ with httpx.Client() as client:
|
|
|
+ time.sleep(3)
|
|
|
+ try:
|
|
|
+ response = client.post(url, headers=headers, data=payload, timeout=3)
|
|
|
+ except Exception as e:
|
|
|
+ client.close()
|
|
|
+ continue
|
|
|
+ if response.status_code != 200:
|
|
|
+ client.close()
|
|
|
+ continue
|
|
|
+ else:
|
|
|
+ text = ''
|
|
|
+ data = response.json()
|
|
|
+ if not data:
|
|
|
+ client.close()
|
|
|
+ continue
|
|
|
+
|
|
|
+ data_list = data['result']
|
|
|
+ airdrop_list = data_list[0]['data']
|
|
|
+ print(airdrop_list)
|
|
|
+ # target_data = eval(data['result'][0]['data'])
|
|
|
+ # target_data = target_data[0]
|
|
|
+ #
|
|
|
+ # print(target_data)
|