Skip to content

Commit

Permalink
Fixes 3
Browse files Browse the repository at this point in the history
  • Loading branch information
AtaTrkgl committed Jan 3, 2025
1 parent b5d9f3d commit 356b965
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/refresh_course_plans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ jobs:
run: |
python src/run.py -scrap_target course_plan
# Commits the changes back to the data repo
- name: Push course_plans.txt to Data
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: './data/course_plans.txt'
destination_repo: 'itu-helper/data'
user_email: '[email protected]'
user_name: 'ITU Helper'
# # Commits the changes back to the data repo
# - name: Push course_plans.txt to Data
# uses: dmnemec/copy_file_to_another_repo_action@main
# env:
# API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
# with:
# source_file: './data/course_plans.txt'
# destination_repo: 'itu-helper/data'
# user_email: '[email protected]'
# user_name: 'ITU Helper'
1 change: 0 additions & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@

# === OTHER ===
MAX_THREAD_COUNT = 4
MAX_THREAD_COUNT_COURSE_PLANS = 2
5 changes: 3 additions & 2 deletions src/course_plan_scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ def scrap_faculty_course_plans(self, faculty_name: str, driver, log_prefix: str=
else:
self.faculty_course_plans[faculty_name][program_type_name].update(program_data)

driver.back()
driver.execute_script("window.history.back();")
# driver.back()

Logger.log_info(f"{log_prefix} Finished Scraping The Faculty: [blue]\"{faculty_name}\"[/blue]")

Expand Down Expand Up @@ -344,7 +345,7 @@ def scrap_course_plans(self):

# Create the threads
threads = []
for i in range(min(MAX_THREAD_COUNT_COURSE_PLANS, len(self.faculties))):
for i in range(min(MAX_THREAD_COUNT, len(self.faculties))):
t = threading.Thread(target=self.scrap_course_plan_thread_routine, args=(i,))
threads.append(t)

Expand Down

0 comments on commit 356b965

Please sign in to comment.