Jelajahi Sumber

outside article monitor

luojunhui 1 bulan lalu
induk
melakukan
648d072e16
1 mengubah file dengan 22 tambahan dan 21 penghapusan
  1. 22 21
      updatePublishedMsgDaily.py

+ 22 - 21
updatePublishedMsgDaily.py

@@ -225,29 +225,30 @@ def update_each_account(db_client: DatabaseConnector, account_info: Dict, latest
         # do
         last_article_in_this_msg = msg_list[-1]
         last_time_stamp_in_this_msg = last_article_in_this_msg['AppMsg']['BaseInfo']['UpdateTime']
-        last_url = last_article_in_this_msg['AppMsg']['DetailInfo'][0]['ContentUrl']
-        resdata = spider.get_account_by_url(last_url)
-        check_id = resdata['data'].get('data', {}).get('wx_gh')
-        if check_id == gh_id:
-            insert_each_msg(
+        # last_url = last_article_in_this_msg['AppMsg']['DetailInfo'][0]['ContentUrl']
+        # resdata = spider.get_account_by_url(last_url)
+        # check_id = resdata['data'].get('data', {}).get('wx_gh')
+        # if check_id == gh_id:
+        insert_each_msg(
+            db_client=db_client,
+            account_info=account_info,
+            msg_list=msg_list
+        )
+        if last_time_stamp_in_this_msg > latest_update_time:
+            next_cursor = response['data']['next_cursor']
+            return update_each_account(
                 db_client=db_client,
                 account_info=account_info,
-                msg_list=msg_list
-            )
-            if last_time_stamp_in_this_msg > latest_update_time:
-                next_cursor = response['data']['next_cursor']
-                return update_each_account(
-                    db_client=db_client,
-                    account_info=account_info,
-                    latest_update_time=latest_update_time,
-                    cursor=next_cursor
-                )
-            log(
-                task="updatePublishedMsgDaily",
-                function="update_each_account",
-                message="账号文章更新成功",
-                data=response
+                latest_update_time=latest_update_time,
+                cursor=next_cursor
             )
+        log(
+            task="updatePublishedMsgDaily",
+            function="update_each_account",
+            message="账号文章更新成功",
+            data=response
+        )
+        return None
     else:
         log(
             task="updatePublishedMsgDaily",
@@ -256,7 +257,7 @@ def update_each_account(db_client: DatabaseConnector, account_info: Dict, latest
             status="fail",
             data=response
         )
-        return
+        return None
 
 
 def check_account_info(db_client: DatabaseConnector, gh_id: str) -> int: