run_weixinzhishu.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- coding: utf-8 -*-
  2. # @Author: wangkun
  3. # @Time: 2023/2/13
  4. # import argparse
  5. import os
  6. import sys
  7. sys.path.append(os.getcwd())
  8. from common.common import Common
  9. from weixinzhishu.weixinzhishu_main.get_weixinzhishu import Weixinzhishu
  10. class Main:
  11. @classmethod
  12. def main(cls, log_type, crawler, env):
  13. if env == "dev":
  14. host = 'http://testhot-words-internal.piaoquantv.com'
  15. else:
  16. host = 'http://hot-words-internal.piaoquantv.com'
  17. Common.logger(log_type, crawler).info("开始抓取微信指数\n")
  18. Weixinzhishu.get_wechat_score(log_type, crawler, host)
  19. Common.del_logs(log_type, crawler)
  20. if __name__ == "__main__":
  21. # parser = argparse.ArgumentParser() ## 新建参数解释器对象
  22. # parser.add_argument('--log_type', type=str) ## 添加参数,注明参数类型
  23. # parser.add_argument('--crawler') ## 添加参数
  24. # parser.add_argument('--strategy') ## 添加参数
  25. # parser.add_argument('--our_uid') ## 添加参数
  26. # parser.add_argument('--oss_endpoint') ## 添加参数
  27. # parser.add_argument('--env') ## 添加参数
  28. # parser.add_argument('--machine') ## 添加参数
  29. # args = parser.parse_args() ### 参数赋值,也可以通过终端赋值
  30. # # print(args)
  31. # Main.main(log_type=args.log_type, crawler=args.crawler)
  32. Main.main("weixin", "weixinzhishu", "prod")