123456789101112131415161718192021222324252627282930313233343536 |
- """
- @author: luojunhui
- @description: try to get some more accounts
- """
- from tasks.crawler_accounts_by_association import ChannelsAccountCrawler
- from tasks.crawler_accounts_by_association import ToutiaoAccountCrawler
- from tasks.crawler_accounts_by_association import HaoKanAccountCrawler
- from tasks.crawler_accounts_by_association import GzhAccountCrawler
- def deal_each_platform(platform: str) -> None:
- """
- deal each platform
- :param platform: str, channels or toutiao
- """
- match platform:
- case "toutiao":
- crawler = ToutiaoAccountCrawler()
- case "sph":
- crawler = ChannelsAccountCrawler()
- case "hksp":
- crawler = HaoKanAccountCrawler()
- case "gzh":
- crawler = GzhAccountCrawler()
- case _:
- raise RuntimeError("platform error")
- # start process
- crawler.deal()
- if __name__ == "__main__":
- platform_list = ["sph", "hksp", "toutiao", "gzh"]
- for platform_id in platform_list:
- deal_each_platform(platform=platform_id)
|