luojunhui 2 miesięcy temu
rodzic
commit
8f97a1dd4b

+ 11 - 9
account_cold_start_daily.py

@@ -8,7 +8,7 @@ from applications import longArticlesMySQL, bot
 from coldStartTasks.crawler.weixinCategoryCrawler import weixinCategory
 from coldStartTasks.publish.publishCategoryArticles import CategoryColdStartTask
 
-DEFAULT_CATEGORY_LIST = ['1030-手动挑号']
+DEFAULT_CATEGORY_LIST = ['account_association']
 
 
 class AccountColdStartDailyTask(object):
@@ -98,7 +98,6 @@ class AccountColdStartDailyTask(object):
 def main(category_list=None, article_source=None):
     """
     main job, use crontab to do job daily
-    todo: 1. 开放一个输入可以输入指定品类  2. 增加对指定账号的抓取&&发布
     :return:
     """
     if not category_list:
@@ -110,15 +109,18 @@ def main(category_list=None, article_source=None):
         if article_source == 'weixin':
             task.crawler_task(category_list=category_list)
 
-        task.publish_task(category_list=category_list, article_source=article_source)
+        # task.publish_task(category_list=category_list, article_source=article_source)
 
 
 if __name__ == '__main__':
-    # 执行微信抓取发布
     main()
+    # # 执行微信抓取发布
+    # main()
+    #
+    # # 执行头条发布
+    # main(
+    #     category_list=['history', 'tech', 'finance', 'entertainment'],
+    #     article_source='toutiao'
+    # )
+
 
-    # 执行头条发布
-    main(
-        category_list=['history', 'tech', 'finance', 'entertainment'],
-        article_source='toutiao'
-    )

+ 2 - 1
coldStartTasks/crawler/weixinCategoryCrawler.py

@@ -11,6 +11,7 @@ from coldStartTasks.filter import article_crawler_duplicate_filter
 
 # 常量
 ACCOUNT_GOOD_STATUS = 1
+ACCOUNT_DAILY_SCRAPE = 1
 DEFAULT_VIEW_COUNT = 0
 DEFAULT_LIKE_COUNT = 0
 DEFAULT_ARTICLE_STATUS = 1
@@ -36,7 +37,7 @@ class weixinCategory(object):
         sql = f"""
             select gh_id, account_source, account_name, account_category, latest_update_time
             from long_articles_accounts 
-            where account_category = '{account_category}' and is_using = {ACCOUNT_GOOD_STATUS};
+            where account_category = '{account_category}' and is_using = {ACCOUNT_GOOD_STATUS} and daily_scrape = {ACCOUNT_DAILY_SCRAPE};
             """
         account_tuple = self.db_client_lam.select(sql)
         result = [