Ver Fonte

优化获取数字币数据

Jack há 1 ano atrás
pai
commit
7ca73caef1
1 ficheiros alterados com 7 adições e 4 exclusões
  1. 7 4
      message/message_coinmarketcap.py

+ 7 - 4
message/message_coinmarketcap.py

@@ -2,6 +2,7 @@
 '''
 使用 httpx 获取 coinmarketcap 最新数字币数据
 '''
+import time
 
 import httpx
 import re
@@ -96,12 +97,13 @@ def get_vix_data():
 
 if __name__ == '__main__':
     url_list = [
-        # ['BTC', 'https://www.coinmarketcap.com/currencies/bitcoin/'],
-        # ['ETH', 'https://www.coinmarketcap.com/currencies/ethereum/'],
+        ['BTC', 'https://coinmarketcap.com/currencies/bitcoin/'],
+        ['ETH', 'https://coinmarketcap.com/currencies/ethereum/'],
+        ['SOL', 'https://coinmarketcap.com/currencies/solana/'],
+        ['SUI', 'https://coinmarketcap.com/currencies/sui/'],
         ['DOGE', 'https://coinmarketcap.com/currencies/dogecoin/'],
         ['ARB', 'https://coinmarketcap.com/currencies/arbitrum/'],
-        ['ATH', 'https://coinmarketcap.com/currencies/aethir/'],
-        ['SUI', 'https://coinmarketcap.com/currencies/sui/'],
+        ['ATH', 'https://coinmarketcap.com/currencies/aethir/']
     ]
 
     text = ''
@@ -110,6 +112,7 @@ if __name__ == '__main__':
         res = get_coinmarketcap_coin_price(data_list[1], data_list[0])
         if res:
             text += res
+        time.sleep(2)
 
     res = get_vix_data()
     if res: