KarriereAt Spamfilter

try to take over the world!

  1. // ==UserScript==
  2. // @name KarriereAt Spamfilter
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description try to take over the world!
  6. // @author We1rd0
  7. // @match https://www.karriere.at/jobs*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function debounce(func, wait) {
  12. let timeout;
  13. return function executedFunction(...args) {
  14. const later = () => {
  15. clearTimeout(timeout);
  16. func(...args);
  17. };
  18. clearTimeout(timeout);
  19. timeout = setTimeout(later, wait);
  20. };
  21. }
  22.  
  23. function killAds() {
  24. let items = Array.from(
  25. document.querySelector("div.m-jobsSearchList__activeJobs > ol").children
  26. ).filter((x) => {
  27. //KERN engineering
  28. let company = x.querySelector(".m-jobsListItem__company")?.innerText;
  29. if (!company) return;
  30. return (
  31. company.includes("epunkt GmbH") ||
  32. company.includes("KERN engineering") ||
  33. company.includes("TODAY Experts GmbH") ||
  34. company.includes("dataformers") ||
  35. company.includes("VACE Engineering GmbH") ||
  36. company.includes("IVM Technical Consultants")
  37. );
  38. });
  39.  
  40. items.forEach((x) => x.remove());
  41. if (items.length > 0) console.log("Killed " + items.length + " ads");
  42. }
  43.  
  44. function clickLoadMoreButton() {
  45. // Function to click the button, modified to be debounced
  46. const clickLoadMoreButtonDebounced = debounce(() => {
  47. const button = document.querySelector(".m-loadMoreJobsButton__button");
  48. if (button && button.offsetHeight !== 0) {
  49. button.click();
  50. console.log("Button clicked!");
  51. } else {
  52. console.log("Button not found or not visible yet.");
  53. }
  54. }, 2000); // 2000 milliseconds = 2 seconds
  55.  
  56. // Create an observer instance to monitor DOM changes
  57. const observer = new MutationObserver((mutations) => {
  58. clickLoadMoreButtonDebounced();
  59. });
  60.  
  61. // Configuration of the observer:
  62. const config = { attributes: true, childList: true, subtree: true };
  63.  
  64. // Select the target node to observe
  65. const targetNode = document.body; // Adjust based on webpage structure
  66.  
  67. // Start observing the target node for configured mutations
  68. observer.observe(targetNode, config);
  69. }
  70.  
  71. (function () {
  72. "use strict";
  73.  
  74. killAds();
  75. // console.log("killed");
  76. // Observe changes in the job list container
  77. const targetNode = document.querySelector("div.m-jobsSearchList__activeJobs > ol");
  78. if (targetNode) {
  79. const config = { childList: true, subtree: true };
  80. const callback = function (mutationsList, observer) {
  81. // Run killAds on any DOM change within the target node
  82. killAds();
  83. };
  84. const observer = new MutationObserver(callback);
  85. observer.observe(targetNode, config);
  86.  
  87. clickLoadMoreButton();
  88. }
  89. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址