run_zhiqingzongqun_recommend.py 712 B

123456789101112131415161718192021222324252627
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2022/10/18
  4. import datetime
  5. import os
  6. import sys
  7. sys.path.append(os.getcwd())
  8. from main.common import Common
  9. from main.zhiqingzongqun_recommend import Recommend
  10. class Main:
  11. @classmethod
  12. def main(cls, log_type, env):
  13. while True:
  14. if 23 >= datetime.datetime.now().hour >= 17:
  15. # if datetime.datetime.now().hour >= 0:
  16. Common.logger(log_type).info('开始抓取知青总群\n')
  17. Recommend.start_wechat(log_type, env)
  18. Recommend.i = 0
  19. Common.del_logs(log_type)
  20. else:
  21. pass
  22. if __name__ == '__main__':
  23. Main.main('recommend', 'prod')