added search_term to init

pull/231/head
Yariv Menachem 2024-12-26 17:25:47 +02:00
parent 4549b2ffc8
commit f1b127ae44
2 changed files with 5 additions and 3 deletions

View File

@ -59,7 +59,8 @@ if __name__ == "__main__":
tg_handler_all = TelegramAllHandler(sites=[Site.GOOZALI],
locations=["Tel Aviv, Israel", "Ramat Gan, Israel",
"Central, Israel", "Rehovot ,Israel"],
title_filters=title_filters)
title_filters=title_filters,
search_term="software engineer")
application.add_handler(CommandHandler("findAll", tg_handler_all.handle))
# application.add_handler(CommandHandler("galssdoor", find_glassdoor))
# application.add_handler(CommandHandler("linkedin", find_linkedin))

View File

@ -13,9 +13,10 @@ logger = create_logger("TelegramAllHandler")
class TelegramAllHandler(TelegramHandler):
def __init__(self, sites: list[Site], locations: list[str], title_filters: list[str]):
def __init__(self, sites: list[Site], locations: list[str], title_filters: list[str],search_term:str):
self.sites_to_scrap = sites
self.locations = locations
self.search_term = search_term
self.title_filters = title_filters
self.telegramBot = TelegramBot()
self.jobRepository = JobRepository()
@ -24,7 +25,7 @@ class TelegramAllHandler(TelegramHandler):
logger.info("start handling")
jobs = scrape_jobs(
site_name=self.sites_to_scrap,
search_term="software engineer",
search_term=self.search_term,
locations=self.locations,
results_wanted=200,
hours_old=48,