Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
0b092b5
Testing tutors form - may not work
maartoon Feb 9, 2025
077f4c0
tutors automation testing
maartoon Feb 16, 2025
253fccf
Update .gitignore
maartoon Feb 16, 2025
746befb
fixed file path
maartoon Feb 23, 2025
18d6232
updated node modules?
maartoon Feb 23, 2025
7f277e3
Revert "updated node modules?"
maartoon Feb 23, 2025
be63cef
moving tutors_list.json to public
maartoon Feb 23, 2025
55e27b2
debugging
maartoon Feb 23, 2025
136a970
Converting to type Tutor
maartoon Feb 23, 2025
87f0750
github workflow - 30mins for now
maartoon Feb 23, 2025
0d261ae
git workflow - 30mins
maartoon Feb 23, 2025
8a71ffd
Fixed workflow
maartoon Feb 23, 2025
c3b31d9
fixed workflow
maartoon Feb 23, 2025
944eb44
fixed 486
starblastbhan1 Feb 26, 2025
972ac50
Merge branch 'martin' of https://github.com/hkn-alpha/website into ma…
starblastbhan1 Feb 26, 2025
a242537
Update fetch-tutors.yml
maartoon Mar 9, 2025
d2fd0c7
Merge branch 'martin' of https://github.com/hkn-alpha/website into ma…
maartoon Mar 9, 2025
fe94b13
env variable and github actions
maartoon Mar 9, 2025
8099372
Update workflow
maartoon Mar 9, 2025
936fbd0
Update workflow to add dotenv
maartoon Mar 9, 2025
c5b0c29
Update workflow for credentials
maartoon Mar 9, 2025
704a269
Update workflow for credentials
maartoon Mar 9, 2025
87809e1
Update workflow for credentials
maartoon Mar 9, 2025
03595ff
Update workflow for credentials
maartoon Mar 9, 2025
e1aa6d1
Update workflow for credentials
maartoon Mar 9, 2025
f195e2a
Updating workflow
maartoon Mar 9, 2025
6946381
Update tutors_list.json [Automated]
github-actions[bot] Mar 9, 2025
ee18acd
Updating workflow
maartoon Mar 9, 2025
54bee2d
Merge branch 'martin' of https://github.com/hkn-alpha/website into ma…
maartoon Mar 9, 2025
48a9984
Update tutors_list.json [Automated]
github-actions[bot] Mar 9, 2025
f399315
Updating workflow
maartoon Mar 9, 2025
0e4017c
Update tutors_list.json [Automated]
github-actions[bot] Mar 9, 2025
3272597
Reverting to every 30mins
maartoon Mar 9, 2025
c2e3bb0
Update tutors_list.json [Automated]
github-actions[bot] Mar 9, 2025
2d7efa5
test
maartoon Mar 30, 2025
f134446
update fetch tutor workflow
maartoon Mar 30, 2025
599ad87
Update every 5 mins
maartoon Mar 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/fetch-tutors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Fetch Tutors Data

on:
schedule:
- cron: '*/5 * * * *' # Runs every 5 minutes
workflow_dispatch:
push:

jobs:
update-tutors:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: martin

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install Dependencies
run: pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client python-dotenv

- name: Create Google Credentials File
run: echo '${{ secrets.GOOGLESHEETAPIKEY }}' > credentials.json

- name: Set Environment Variable
run: echo "GOOGLESHEETAPIKEY=$GITHUB_WORKSPACE/credentials.json" >> $GITHUB_ENV

- name: Run fetchTutors Script
run: python src/content/StudentServices/fetchTutors.py

- name: Commit and Push Changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add public/tutors_list.json
git commit -m "Update tutors_list.json [Automated]" || echo "No changes to commit"
git push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?
src/content/StudentServices/sheets_api_credentials.json
.env
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
},
"dependencies": {
"blurhash-to-css": "^0.5.5",
"dotenv": "^16.4.7",
"svelte-routing": "^1.6.0",
"svelte-select": "^5.6.1"
}
Expand Down
1 change: 1 addition & 0 deletions public/tutors_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[["martinxu1234@gmail.com", "Testing", "Yes", "ECE 110, ECE 220, ECE 313"], ["src15@illinois.edu", "Sohithesh Chevireddy", "Yes", "ECE 110, ECE 120, ECE 210, ECE 220, ECE 310, ECE 313"], ["sohumb3@illinois.edu", "Sohum Bhan", "Yes", "ECE 210"], ["cookiehp3@gmail.com", "Testing Dummy", "Yes", "ECE 110, ECE 310, ECE 313"], ["cookiehp2@gmail.com", "Mike Ross", "Yes", "ECE 120, ECE 210, ECE 220, ECE 313"], ["martinxu1234@gmail.com", "Nevermind", "Yes", "ECE 120, ECE 220, PHYS 214"]]
46 changes: 46 additions & 0 deletions src/content/StudentServices/fetchTutors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import os
import json
from google.oauth2.service_account import Credentials
from googleapiclient.discovery import build

sheet_id = "1WnuVYrK_CKNv2iooqLCqYOpvyX8U401lMseo0DQ-Kd8"
netlify_build_hook = "https://api.netlify.com/build_hooks/67bb8caad28293b98a790a50"

def fetchTutors():

SCOPES = ['https://www.googleapis.com/auth/spreadsheets']

SERVICE_ACCOUNT_FILE = os.getenv("GOOGLESHEETAPIKEY")

credientials = Credentials.from_service_account_file(SERVICE_ACCOUNT_FILE, scopes=SCOPES)

service = build('sheets', 'v4', credentials = credientials)

sheets = service.spreadsheets()

ranges = "B:E"
sheet_read = sheets.values().get(spreadsheetId=sheet_id, range=ranges).execute()

responses = sheet_read.get('values', [])

tutors = list()

for entry in responses:
# Skip empty lists sand header rows!
if not entry: # Skip empty lists
continue
if entry == responses[0]: # Skip the header row (optional)
continue

if entry[2] == "Yes":
tutors.append(entry)

PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../../"))
json_file_path = os.path.join(PROJECT_ROOT, "public", "tutors_list.json")
# Serialize to JSON
with open(json_file_path, 'w') as f:
json.dump(tutors, f, ensure_ascii=False)

print(tutors)

fetchTutors()
4 changes: 2 additions & 2 deletions src/content/StudentServices/review_sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const reviewSessions: Record<1 | 2 | 3, ReviewSession[]>= {
course: "ECE 486",
//time: "TBD",
location: "ECEB 1015",
time: "2/2, 3:00-5:00PM",
time: "3/2, 3:00-5:00PM",
// location: "ECEB 1002",
// recordingLink: "https://mediaspace.illinois.edu/media/t/1_sxn7f3z6",
// slidesLink: "https://docs.google.com/presentation/d/1umRdm6g6jMtTdmjKkQ4TOy9RG-BespwyCiBSjszgNoM/edit#slide=id.p"
Expand Down Expand Up @@ -342,7 +342,7 @@ export const reviewSessions: Record<1 | 2 | 3, ReviewSession[]>= {
// // location: "ECEB 1013",
// // recordingLink: "https://mediaspace.illinois.edu/media/t/1_zr2finr9",
// // scribblesLink: "https://academic.acm.illinois.edu/assets/cs438/fa24/mt1/pdf/ACM_438_MT1_Review_scribbles.pdf",
// // slidesLink: "https://drive.google.com/file/d/1RqSnWJsyhM_CvzVChLeQ3l6vumhbuaii/view?usp=drive_link",
// slidesLink: "https://drive.google.com/file/d/1RqSnWJsyhM_CvzVChLeQ3l6vumhbuaii/view?usp=drive_link",

// },
{
Expand Down
Loading