12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- """
- @author: luojunhui
- 账号联想---账号搜索任务
- """
- import traceback
- from argparse import ArgumentParser
- from datetime import datetime
- from applications import bot
- from coldStartTasks.crawler.weixin_account_association_crawler import AccountAssociationCrawler
- def main():
- """
- 账号联想---账号搜索任务
- :return:
- """
- parser = ArgumentParser()
- parser.add_argument("--run-date",
- help="Run only once for date in format of %Y-%m-%d. \
- If no specified, run as daily jobs.")
- args = parser.parse_args()
- if args.run_date:
- biz_date = datetime.strptime(args.run_date, "%Y-%m-%d")
- else:
- biz_date = datetime.today()
- try:
- account_association_crawler = AccountAssociationCrawler()
- account_association_crawler.run_account_association(biz_date=biz_date)
- except Exception as e:
- bot(
- title="账号联想任务失败",
- detail={
- "error": str(e),
- "error_stack": traceback.format_exc()
- }
- )
- if __name__ == '__main__':
- main()
|