Συζητήσεις » Αιτήματα Δημιουργίας

Adding a map to Indeed / Linkedin job board posts?

§
Δημοσιεύτηκε: 13/08/2023

Hi all,

I'm looking to see if there is a script that will add to job postings as they already have a location and sometimes a zipcode too. Trying to get an idea of where the job is by showing the general area of where the location is within the state via google maps. Trying to speed up the job searching process.

Thanks!

§
Δημοσιεύτηκε: 15/08/2023
Επεξεργάστηκε: 15/08/2023

This is the concept for indeed, but I won't do it for you

const companyInfoElements = document.querySelectorAll(".companyInfo");

companyInfoElements.forEach((companyInfo, i) => {
const companyName = companyInfo.querySelector(".companyName").textContent;
const companyLocation = companyInfo.querySelector(".companyLocation").textContent;

const googleMapsUrl = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(companyLocation)}`;

const iframe = document.createElement("iframe");
iframe.setAttribute("src", googleMapsUrl);
iframe.setAttribute("width", "300");
iframe.setAttribute("height", "200");
iframe.style.position = "absolute";
iframe.style.display = "none";

document.querySelectorAll("li")[i].addEventListener("mouseenter", () => {
iframe.style.display = "block";
});

document.querySelectorAll("li")[i].addEventListener("mouseleave", () => {
iframe.style.display = "none";
});

document.querySelectorAll("li")[i].appendChild(iframe);
});

Δημοσίευση απάντησης

Συνδεθείτε για να δημοσιεύσετε μια απάντηση.

长期地址
遇到问题?请前往 GitHub 提 Issues。