fixed not sending the right response and remove it tag

pull/231/head
Yariv Menachem 2024-12-22 16:43:48 +02:00
parent 327b13f82d
commit cbe3a97a73
2 changed files with 5 additions and 5 deletions

View File

@ -8,13 +8,14 @@ from jobspy.telegram_bot import TelegramBot
logger = create_logger("Main")
filter_by_title: list[str] = ["test", "qa", "Lead", "Full-Stack", "Full Stack", "Fullstack", "Frontend", "Front-end", "Front End", "DevOps", "Physical", "Staff"
"data", "automation", "BI", "Principal", "Architect", "Android", "IT", "Machine Learning", "Student"]
"data", "automation", "BI", "Principal", "Architect", "Android", "Machine Learning", "Student"]
def filter_jobs_by_title_name(job):
def filter_jobs_by_title_name(job: JobPost):
for filter_title in filter_by_title:
if re.search(filter_title, job.title, re.IGNORECASE):
logger.info(f"job filtered out by title: {job.id} , {job.title}")
logger.info(f"job filtered out by title: {job.id} , {
job.title} , found {filter_title}")
return False
return True

View File

@ -89,11 +89,10 @@ class GoozaliScraper(Scraper):
filtered_rows_by_column_choice, scraper_input.hours_old)
dict_column_name_to_column: dict[str, GoozaliColumn] = create_dict_by_key_and_value(
goozali_response.data.columns, extract_goozali_column_name)
response: list[JobPost] = []
# map to JobResponse Object
for row in filtered_rows_by_age_and_column_choice:
job_post = self.mapper.map_goozali_response_to_job_post(
row, dict_column_name_to_column)
response.append(job_post)
job_list.append(job_post)
return JobResponse(jobs=job_list)