account_association_task.py 863 B

1234567891011121314151617181920212223242526272829303132
  1. """
  2. @author: luojunhui
  3. 账号联想---账号搜索任务
  4. """
  5. from argparse import ArgumentParser
  6. from datetime import datetime
  7. from coldStartTasks.crawler.weixin_account_association_crawler import AccountAssociationCrawler
  8. def main():
  9. """
  10. 账号联想---账号搜索任务
  11. :return:
  12. """
  13. parser = ArgumentParser()
  14. parser.add_argument("--run-date",
  15. help="Run only once for date in format of %Y-%m-%d. \
  16. If no specified, run as daily jobs.")
  17. args = parser.parse_args()
  18. if args.run_date:
  19. biz_date = datetime.strptime(args.run_date, "%Y-%m-%d")
  20. else:
  21. biz_date = datetime.today()
  22. account_association_crawler = AccountAssociationCrawler()
  23. account_association_crawler.run_account_association(biz_date=biz_date)
  24. if __name__ == '__main__':
  25. main()