account_explore_task.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  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. from tasks.crawler_accounts_by_association import GzhAccountCrawler
  9. def deal_each_platform(platform: str) -> None:
  10. """
  11. deal each platform
  12. :param platform: str, channels or toutiao
  13. """
  14. match platform:
  15. case "toutiao":
  16. crawler = ToutiaoAccountCrawler()
  17. case "sph":
  18. crawler = ChannelsAccountCrawler()
  19. case "hksp":
  20. crawler = HaoKanAccountCrawler()
  21. case "gzh":
  22. crawler = GzhAccountCrawler()
  23. case _:
  24. raise RuntimeError("platform error")
  25. # start process
  26. crawler.deal()
  27. if __name__ == "__main__":
  28. platform_list = ["sph", "hksp", "toutiao", "gzh"]
  29. for platform_id in platform_list:
  30. deal_each_platform(platform=platform_id)