Jack 11 月之前
父节点
当前提交
44713223cc
共有 5 个文件被更改,包括 44 次插入4 次删除
  1. 1 1
      ai_news/Readme.md
  2. 1 1
      ai_news/ai_news.py
  3. 2 1
      ai_news/config.json
  4. 40 0
      manual/airdrop_list/main.py
  5. 0 1
      requirements.txt

+ 1 - 1
ai_news/Readme.md

@@ -1,5 +1,5 @@
 ## Installation
-pip install httpx beautifulsoup ollama matrix_client
+pip install httpx beautifulsoup4 ollama matrix_client
 
 ## Usage
 python main.py

+ 1 - 1
ai_news/ai_news.py

@@ -170,7 +170,7 @@ class AINEWS:
 
         async with async_playwright() as p:
             # 启动浏览器
-            browser = await p.chromium.launch(headless=True)
+            browser = await p.chromium.launch(headless=False)
             # 创建浏览器上下文
             context = await browser.new_context()
 

+ 2 - 1
ai_news/config.json

@@ -24,7 +24,8 @@
       "https://foresightnews.pro/news",
       "https://www.web3sj.com/news/",
       "https://www.techflowpost.com/newsletter/index.html",
-      "https://www.theblockbeats.info/newsflash?type=2"
+      "https://www.theblockbeats.info/newsflash?type=2",
+      "https://www.528btc.com/kx/"
     ],
     "role": "你是一个新闻报播员, 负责理解和报播新闻, 请用中文回答",
     "prompt_words": "这是最近的数字币相关的新闻, 你现在是一个新闻报播员, 帮我整理并总结以上新闻, 分析一下数字币接下来大概得走势, 再在此基础上, 给每一条新闻做一个情感分析, 最后输出一下总得分"

+ 40 - 0
manual/airdrop_list/main.py

@@ -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)

+ 0 - 1
requirements.txt

@@ -62,7 +62,6 @@ pyee==11.1.0
 PyExecJS==1.5.1
 pygpt4all==1.1.0
 pygptj==2.0.3
-pyllamacpp==2.4.2
 pymongo==4.6.1
 pyOpenSSL==23.3.0
 pyparsing==3.1.1