account_explore_task.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. platform_list = ["hksp", "sph"]
  30. for platform_id in platform_list:
  31. deal_each_platform(platform=platform_id)