account_explore_task.py 951 B

12345678910111213141516171819202122232425262728293031323334
  1. """
  2. @author: luojunhui
  3. @description: try to get some more accounts
  4. """
  5. from tasks.crawler_accounts_by_association import ChannelsAccountCrawler
  6. from tasks.crawler_accounts_by_association import ToutiaoAccountCrawler
  7. from tasks.crawler_accounts_by_association import HaoKanAccountCrawler
  8. def deal_each_platform(platform: str) -> None:
  9. """
  10. deal each platform
  11. :param platform: str, channels or toutiao
  12. """
  13. match platform:
  14. case "toutiao":
  15. crawler = ToutiaoAccountCrawler()
  16. case "sph":
  17. crawler = ChannelsAccountCrawler()
  18. case "hksp":
  19. crawler = HaoKanAccountCrawler()
  20. case _:
  21. raise RuntimeError("platform error")
  22. # start process
  23. crawler.deal()
  24. if __name__ == "__main__":
  25. # platform_list = ["sph", "hksp", "toutiao"]
  26. platform_list = ["hksp", "sph"]
  27. for platform_id in platform_list:
  28. deal_each_platform(platform=platform_id)