Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32-support-lever-board #35

Merged
merged 4 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions addon/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ function showCoverLetter(coverLetter) {
const copyButton = document.createElement("button");
copyButton.innerHTML = "Copy to Clipboard";
copyButton.classList.add("btn", "btn-primary", "mt-2");
copyButton.onclick = function () {
copyToClipboard(coverLetter);
};
const div = document.createElement("div");
div.innerHTML = `<div class="mt-2">
<p>Cover Letter:</p>
Expand All @@ -60,6 +57,9 @@ function showCoverLetter(coverLetter) {
clArea.rows = 10;
clArea.style.width = "100%";
clArea.style.resize = "none";
copyButton.onclick = function () {
copyToClipboard(clArea.value);
};

const mainDiv = document.getElementById("popup");
mainDiv.appendChild(copyButton);
Expand All @@ -74,6 +74,7 @@ generateCLButton.addEventListener("click", async function () {
const baseUrl = [savedHost, "job-details"].join("/");
let jobBoard = "";
if (currentTab.url.includes("greenhouse")) jobBoard = "greenhouse";
if (currentTab.url.includes("lever")) jobBoard = "lever";

if (!jobBoard) {
notSupported(currentTab.title, currentTab.url);
Expand Down
4 changes: 3 additions & 1 deletion python/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dotenv import load_dotenv
from flask_cors import CORS

from main import fetch_job_details_from_greenhouse
from main import fetch_job_details_from_greenhouse, fetch_job_details_from_lever
from services.openai import generate_cover_letter
from services.resume_best_match import get_best_match_from_resume
from services.resume_vectorizor import vectorize_resume
Expand Down Expand Up @@ -33,6 +33,8 @@ def get_job_details(job_board):
match job_board:
case "greenhouse":
job_details = fetch_job_details_from_greenhouse(job_url)
case "lever":
job_details = fetch_job_details_from_lever(job_url)

resume_vectors, resume_segments = vectorize_resume()
best_match_section = get_best_match_from_resume(job_details, resume_vectors, resume_segments)
Expand Down
13 changes: 13 additions & 0 deletions python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,16 @@ def fetch_job_details_from_greenhouse(url):
text = text[:text.find("Apply for this job")]

return text


def fetch_job_details_from_lever(url):
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
}
response = requests.get(url, headers=headers)
soup = BeautifulSoup(response.content, 'html.parser')

text = soup.get_text()
text = text[:text.find("Apply for this job")]

return text