account_explore_task.py 913 B

123456789101112131415161718192021222324252627282930313233
  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. for platform_id in platform_list:
  27. deal_each_platform(platform=platform_id)