Explorar o código

删除无用代码,修改格式

luojunhui hai 2 meses
pai
achega
80a16103f1

+ 0 - 2
applications/__init__.py

@@ -5,9 +5,7 @@ from .denetMysql import DeNetMysql
 from .longArticlesMysql import longArticlesMySQL
 from .pqMysql import PQMySQL
 from .functions import Functions
-from .data_works import ODPSApi
 from .wxSpiderApi import WeixinSpider
-from .algApi import AlgApi
 from .pqFunctionApi import PQAPI
 from .aliyunLogApi import log
 from .feishuBotApi import bot, create_feishu_columns_sheet

+ 0 - 29
applications/algApi.py

@@ -1,29 +0,0 @@
-"""
-@author: luojunhui
-"""
-import requests
-
-
-class AlgApi(object):
-    """
-    算法api
-    """
-    @classmethod
-    def getScoreList(cls, accountName, title_list):
-        """
-        获取得分
-        :return:
-        """
-        url = "http://61.48.133.26:6060/score_list"
-        body = {
-            "account_nickname_list": [accountName],
-            "text_list": title_list,
-            "max_time": None,
-            "min_time": None,
-            "interest_type": "avg",
-            "sim_type": "mean",
-            "rate": 0.1
-        }
-        response = requests.post(url=url, headers={}, json=body)
-        return response.json()
-

+ 0 - 0
applications/const.py → applications/const/__init__.py


+ 0 - 34
applications/data_works.py

@@ -1,34 +0,0 @@
-"""
-@author: luojunhui
-"""
-from odps import ODPS
-
-
-class ODPSApi(object):
-    """
-    PyODPS class, get data from odps server
-    """
-
-    def __init__(self):
-        self.endpoint = "http://service.cn.maxcompute.aliyun.com/api"
-        self.access_id = "LTAIWYUujJAm7CbH"
-        self.access_key = "RfSjdiWwED1sGFlsjXv0DlfTnZTG1P"
-        self.project = "loghubods"
-
-        self.od = ODPS(
-            access_id=self.access_id,
-            secret_access_key=self.access_key,
-            endpoint=self.endpoint,
-            project=self.project,
-        )
-
-    def select(self, sql):
-        """
-        :param sql: 查询语句
-        :return: odps_obj{}
-        """
-        result = []
-        with self.od.execute_sql(sql).open_reader() as reader:
-            for record in reader:
-                result.append(record)
-        return result

+ 40 - 0
coldStartTasks/crawler/weixin_category_top.py

@@ -0,0 +1,40 @@
+"""
+@author: luojunhui
+"""
+import json
+
+import requests
+
+url = "https://tophub.today/do"
+
+data = {
+    "p": 1,
+    "day": "2025-02-3",
+    "nodeid": "5952",
+    "t": "itemsbydate",
+    "c": "node"
+}
+
+headers = {
+    'accept': 'application/json, text/javascript, */*; q=0.01',
+    'accept-language': 'zh,zh-CN;q=0.9',
+    'content-type': 'application/x-www-form-urlencoded; charset=UTF-8',
+    'origin': 'https://tophub.today',
+    'priority': 'u=1, i',
+    'cookie': 'itc_center_user=687fMUyII7NF3Z7BXajouKHhRuaQ0naC1NPNVN9cTdtkjxZff0O0ryw5tnK7xCg9CVsqPY4q%2BfMhkcamxx8F1ZQUHZJbuGhjYM4%2FAiDyXpQTTA;',
+    'referer': 'https://tophub.today/n/x9ozmmYeXb',
+    'sec-ch-ua': '"Not(A:Brand";v="99", "Google Chrome";v="133", "Chromium";v="133"',
+    '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/133.0.0.0 Safari/537.36',
+    'x-requested-with': 'XMLHttpRequest'
+}
+
+response = requests.request("POST", url, headers=headers, data=data)
+
+response_json = response.json()
+
+print(json.dumps(response_json, indent=4, ensure_ascii=False))