Skip to content

Instantly share code, notes, and snippets.

@Mark7888
Created September 24, 2025 12:12
Show Gist options
  • Select an option

  • Save Mark7888/5f3aa93b4f8572d9744b15cf4bb5792b to your computer and use it in GitHub Desktop.

Select an option

Save Mark7888/5f3aa93b4f8572d9744b15cf4bb5792b to your computer and use it in GitHub Desktop.
This Tampermonkey script will check the status of ads on schonherz.hu, whether you already applied to the job or not.
// ==UserScript==
// @name Schonherz Ad Checker
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Append .resultArea text to ads on schonherz.hu
// @match https://schonherz.hu/diakmunkak/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function startChecker() {
console.log("Started checking already applied ads");
const container = document.querySelector("div.row.ad-list");
if (!container) return; // not on a list page
const interval = setInterval(async () => {
// if we reached the end, stop
if (container.querySelector("div.nomore")) {
clearInterval(interval);
console.log("Reached end of ad list, stopping.");
return;
}
// iterate over potential ads
const ads = container.querySelectorAll("div.col-md-8:not(.checked-result):not(.loading-info)");
for (const ad of ads) {
try {
const linkEl = ad.querySelector("a.sdcard");
const titleEl = ad.querySelector(".text h4 a");
if (!linkEl || !titleEl) continue;
const url = linkEl.href;
// fetch details page
const resp = await fetch(url);
const html = await resp.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
const resultDiv = doc.querySelector(".resultArea");
if (resultDiv) {
const text = resultDiv.textContent.trim();
titleEl.innerHTML += ` <i style="color: orange;">${text}</i>`;
}
// mark as checked
ad.classList.add("checked-result");
} catch (err) {
console.error("Error processing ad:", err);
}
}
}, 1000);
}
window.addEventListener("load", startChecker);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment