Redirect to gaytorrent.ru

Redirects gaytor.rent links back to the old gaytorrent.ru domain

// ==UserScript==
// @name         Redirect to gaytorrent.ru
// @version      1.3
// @description  Redirects gaytor.rent links back to the old gaytorrent.ru domain
// @match        *://*.gaytorrent.ru/*
// @match        *://*.gaytor.rent/*
// @grant        none
// @namespace https://greasyfork.org/users/779030
// ==/UserScript==

(function() {
    'use strict';

    // Define the domain alteration
    var originalDomain = /gaytor\.rent/gi;
    var alteredDomain = 'gaytorrent.ru';

    // Alter links on the page and update displayed URL for altered links (excluding links with a specific subclass)
    function alterLinks() {
        var links = document.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
            var link = links[i];
            var originalURL = link.href;
            var alteredURL = originalURL.replace(originalDomain, alteredDomain);
            link.href = alteredURL;
            if (alteredURL !== originalURL && !link.classList.contains('navigation-link') && !originalURL.includes('compose?')) {
              link.textContent = "**"+alteredURL+"**"; // Update displayed text with the altered URL
            }
        }
    }

    // Periodically call the alterLinks function
    setInterval(alterLinks, 3000); // Adjust the interval time (in milliseconds) as needed
})();