jitenbot/bot/crawlers/factory.py

21 lines
755 B
Python
Raw Normal View History

2023-05-06 18:15:38 +00:00
from bot.targets import Targets
from bot.crawlers.crawlers import JitenonKokugoCrawler
from bot.crawlers.crawlers import JitenonYojiCrawler
from bot.crawlers.crawlers import JitenonKotowazaCrawler
from bot.crawlers.crawlers import Smk8Crawler
from bot.crawlers.crawlers import Daijirin2Crawler
2023-07-18 05:43:38 +00:00
from bot.crawlers.crawlers import Sankoku8Crawler
2023-05-06 18:15:38 +00:00
2023-05-06 21:55:00 +00:00
def new_crawler(target):
2023-05-06 18:15:38 +00:00
crawler_map = {
Targets.JITENON_KOKUGO: JitenonKokugoCrawler,
Targets.JITENON_YOJI: JitenonYojiCrawler,
Targets.JITENON_KOTOWAZA: JitenonKotowazaCrawler,
Targets.SMK8: Smk8Crawler,
Targets.DAIJIRIN2: Daijirin2Crawler,
2023-07-18 05:43:38 +00:00
Targets.SANKOKU8: Sankoku8Crawler,
2023-05-06 18:15:38 +00:00
}
2023-05-06 21:55:00 +00:00
return crawler_map[target](target)