windowdog 1 month ago
parent
commit
f1a6a02291
1 changed files with 18 additions and 5 deletions
  1. 18 5
      src/code/get_downloads_from_gmgn_pump.py

+ 18 - 5
src/code/get_downloads_from_gmgn_pump.py

@@ -149,7 +149,7 @@ async def handle_Downloads_gmgn_pump_file_timed():
         
         
         df_for_feishu   =df[df["save_timestamp"] ==df["save_timestamp"].max()].reset_index(drop=True)
-        df_for_feishu = df[df['age'].str.contains('h', case=False, na=False)].reset_index(drop=True)
+        df_for_feishu = df_for_feishu[df_for_feishu['age'].str.contains('h', case=False, na=False)].reset_index(drop=True)
         
         df_for_feishu['age'] = df_for_feishu['age'].str.replace('h', '', case=False)
         df_for_feishu["age"] = df_for_feishu["age"].astype(int)
@@ -163,14 +163,14 @@ async def handle_Downloads_gmgn_pump_file_timed():
         return
 
 
-async def send_feishu(str_text_df):
+async def send_feishu(title,str_text):
 
     payload_message = {
         "msg_type": "post",
         "content": {
             "post": {
                 "zh_cn": {
-                    "title": "gmgn 12小时内的pump 信息",
+                    "title": title ,
                     "content": [
                         
                     ]
@@ -187,7 +187,7 @@ async def send_feishu(str_text_df):
 
     content.append([{
         "tag": "text",
-        'text':  str_text_df
+        'text':  str_text
     } 
     ])
 
@@ -202,7 +202,15 @@ async def send_feishu(str_text_df):
     return 
      
 
+async def send_cur_files_feishu_timed():
+    global set_has_read_file
+    arr_has_read_file = list(set_has_read_file)
+    str_text =  "\n".join(arr_has_read_file)
 
+    await send_feishu( title = "read files",str_text =str_text)
+
+
+    return
 
 async def ready_send_feishu_timed():
     global df_for_feishu
@@ -212,7 +220,7 @@ async def ready_send_feishu_timed():
     if str_text_df=="":
         return
 
-    await send_feishu( str_text_df)
+    await send_feishu( title= "gmgn 12小时内的pump 信息" , str_text=str_text_df)
     df_for_feishu=pd.DataFrame()
     return
 
@@ -245,6 +253,11 @@ async def timedTasks():
         #  一次飞书
         await ready_send_feishu_timed()
    
+
+    if cur_timedTasks_idx%(3600*2+120+9)==0:
+    #  一次飞书
+        await send_cur_files_feishu_timed()
+
     return