Skip to content

Instantly share code, notes, and snippets.

@ImMALWARE
Last active June 4, 2024 17:26

Revisions

  1. ImMALWARE revised this gist Jun 4, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion LZTSympathiesButton.user.js
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@

    function like(post_id, xftoken) {
    const r = new XMLHttpRequest();
    r.open("POST", "https://zelenka.guru/posts/"+post_id+"/like?_xfNoRedirect=1&_xfToken="+xftoken+"&_xfResponseType=json");
    r.open("POST", "https://lolz.live/posts/"+post_id+"/like?_xfNoRedirect=1&_xfToken="+xftoken+"&_xfResponseType=json");
    r.send();
    }

  2. ImMALWARE revised this gist Jun 4, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion LZTSympathiesButton.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @name Кнопка симпатии в розыгрышах
    // @version 1.1
    // @version 1.1.1
    // @description Прям как хотел огузок
    // @author MALWARE
    // @match https://zelenka.guru/forums/contests*
  3. ImMALWARE revised this gist Jun 4, 2024. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions LZTSympathiesButton.user.js
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@
    // @description Прям как хотел огузок
    // @author MALWARE
    // @match https://zelenka.guru/forums/contests*
    // @match https://lolz.guru/forums/contests*
    // @match https://lolz.live/forums/contests*
    // @grant none
    // @icon https://zelenka.guru/favicon.ico
    // ==/UserScript==
  4. ImMALWARE renamed this gist Jul 28, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  5. ImMALWARE revised this gist Mar 8, 2023. 1 changed file with 35 additions and 13 deletions.
    48 changes: 35 additions & 13 deletions script.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @name Кнопка симпатии в розыгрышах
    // @version 1.0
    // @version 1.1
    // @description Прям как хотел огузок
    // @author MALWARE
    // @match https://zelenka.guru/forums/contests*
    @@ -16,16 +16,38 @@ function like(post_id, xftoken) {

    (function() {
    'use strict';
    const xftoken = document.querySelector('input[name="_xfToken"]').value;
    const discussionListItems = document.querySelectorAll("div.discussionListItem");
    for (let i = 0; i < discussionListItems.length; i++) {
    const likeButtonElement = document.createElement("a");
    likeButtonElement.className = "threadControl Tooltip OverlayTrigger far fa-heart";
    likeButtonElement.addEventListener("click", function() {
    like(new URLSearchParams(new URL(discussionListItems[i].querySelector('a[data-cachedtitle="Пожаловаться"]').href).search).get("post_id"), xftoken);
    likeButtonElement.className = "threadControl Tooltip OverlayTrigger fa fa-heart";
    XenForo.stackAlert('Симпатия поставлена!', 1000);
    });
    discussionListItems[i].querySelector("span.controls").appendChild(likeButtonElement);
    }
    const xftoken = document.querySelector('input[name="_xfToken"]').value;
    const discussionList = document.querySelector("div.discussionListItems");
    const addLikeButton = function(discussionListItem) {
    const likeButtonElement = document.createElement("a");
    likeButtonElement.className = "threadControl Tooltip OverlayTrigger far fa-heart";
    likeButtonElement.addEventListener("click", function() {
    like(new URLSearchParams(new URL(discussionListItem.querySelector('a[data-cachedtitle="Пожаловаться"]').href).search).get("post_id"), xftoken);
    likeButtonElement.className = "threadControl Tooltip OverlayTrigger fa fa-heart";
    XenForo.stackAlert('Симпатия поставлена!', 1000);
    });
    try {
    discussionListItem.querySelector("span.controls").appendChild(likeButtonElement);
    }
    catch(e) {
    console.log(discussionListItem);
    console.log(e);
    }
    };
    const discussionListItems = document.querySelectorAll("div.discussionListItem");
    for (let i = 0; i < discussionListItems.length; i++) {
    addLikeButton(discussionListItems[i]);
    }
    const observer = new MutationObserver(function(mutations) {
    mutations.forEach(function(mutation) {
    if (mutation.type === "childList") {
    mutation.addedNodes.forEach(function(node) {
    if (node.nodeType === Node.ELEMENT_NODE && node.classList.contains("discussionListItem")) {
    addLikeButton(node);
    }
    });
    }
    });
    });
    observer.observe(document.body, { childList: true, subtree: true });
    })();
  6. ImMALWARE revised this gist Mar 8, 2023. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions script.user.js
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,7 @@
    // @version 1.0
    // @description Прям как хотел огузок
    // @author MALWARE
    // @match https://zelenka.guru/forums/contests/
    // @match https://zelenka.guru/forums/contests
    // @match https://zelenka.guru/forums/contests*
    // @grant none
    // @icon https://zelenka.guru/favicon.ico
    // ==/UserScript==
  7. ImMALWARE revised this gist Mar 8, 2023. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions script.user.js
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@
    // @description Прям как хотел огузок
    // @author MALWARE
    // @match https://zelenka.guru/forums/contests/
    // @match https://zelenka.guru/forums/contests
    // @grant none
    // @icon https://zelenka.guru/favicon.ico
    // ==/UserScript==
  8. ImMALWARE created this gist Mar 8, 2023.
    31 changes: 31 additions & 0 deletions script.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    // ==UserScript==
    // @name Кнопка симпатии в розыгрышах
    // @version 1.0
    // @description Прям как хотел огузок
    // @author MALWARE
    // @match https://zelenka.guru/forums/contests/
    // @grant none
    // @icon https://zelenka.guru/favicon.ico
    // ==/UserScript==

    function like(post_id, xftoken) {
    const r = new XMLHttpRequest();
    r.open("POST", "https://zelenka.guru/posts/"+post_id+"/like?_xfNoRedirect=1&_xfToken="+xftoken+"&_xfResponseType=json");
    r.send();
    }

    (function() {
    'use strict';
    const xftoken = document.querySelector('input[name="_xfToken"]').value;
    const discussionListItems = document.querySelectorAll("div.discussionListItem");
    for (let i = 0; i < discussionListItems.length; i++) {
    const likeButtonElement = document.createElement("a");
    likeButtonElement.className = "threadControl Tooltip OverlayTrigger far fa-heart";
    likeButtonElement.addEventListener("click", function() {
    like(new URLSearchParams(new URL(discussionListItems[i].querySelector('a[data-cachedtitle="Пожаловаться"]').href).search).get("post_id"), xftoken);
    likeButtonElement.className = "threadControl Tooltip OverlayTrigger fa fa-heart";
    XenForo.stackAlert('Симпатия поставлена!', 1000);
    });
    discussionListItems[i].querySelector("span.controls").appendChild(likeButtonElement);
    }
    })();