Skip to content

Commit

Permalink
32-support-lever-board (#35)
Browse files Browse the repository at this point in the history
* ✨ feat: Copy to clipboard by button

* ✨ feat: add support for python scrapping

* ✨ feat: allow requesting from lever sites
  • Loading branch information
UmairJibran authored Nov 8, 2024
1 parent 6f19e72 commit fdbdaff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
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

0 comments on commit fdbdaff

Please sign in to comment.