DynamoAlarm

🌲kattn

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        DynamoAlarm
// @namespace   Zweitmarkt Alarm
// @match       *://karten.dynamo-dresden.de/*
// @grant       none
// @version     187.1.8.7
// @author      -
// @description 🌲kattn
// ==/UserScript==

function main() {
  const bodyEl = document.body.textContent.toLowerCase();
  if (bodyEl.includes("6. ligaheimspiel")) {
    if (bodyEl.includes("zweitmarkt") || bodyEl.includes("filter")) {
      new Audio("http://dl.dropboxusercontent.com/scl/fi/3901qni32qqrwzimcb6vg/alarm.mp3?rlkey=6pvo79inlqhhgxrzmftbo7h9f&st=istrp926&dl=0").play()

      const body = document.getElementsByTagName("body")[0];
      body.style.setProperty("background-color", "green", "important");

      setTimeout(() => {
        body.style.setProperty("background-image", "none", "important");
      }, 500)
    } else {
      setTimeout(() => {
        location.reload()
      }, 5000)
    }
  }
}

window.addEventListener("load", function() {
  main();
});