Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name gomoroshiner
- // @namespace g0moroshiner
- // @icon http://i.imgur.com/GPqOP3o.png
- // @version 1
- // @grant none
- // @match *://2ch.hk/*
- // ==/UserScript==
- function addJQuery(callback) {
- var script = document.createElement("script");
- script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
- script.addEventListener('load', function() {
- var script = document.createElement("script");
- script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
- document.body.appendChild(script);
- }, false);
- document.body.appendChild(script);
- }
- var elements, postid, replyid;
- setInterval(function main() {
- elements = document.getElementsByClassName("post-details");
- for (i = 0; i < elements.length; i++) {
- postid = "post-body-";
- for (l = 0; l < 4; l++){
- if (elements[i].getElementsByTagName("span")[l].innerHTML == "!!lmotSi2gK." && elements[i].getElementsByTagName("checkedg").length == 0){
- postid = postid + elements[i].id.match(/\d+/);
- replyid = document.getElementById(postid).getElementsByTagName("blockquote")[0].getElementsByTagName("a");
- if (replyid.length > 0){
- replyid = document.getElementById(postid).getElementsByTagName("blockquote")[0].getElementsByTagName("a")[0].innerHTML.match(/\d+/);
- document.getElementById(postid).getElementsByTagName("blockquote")[0].innerHTML = "<a href=\"" + "/es/res" + document.URL.match(/\d+/g)[1] + ".html" + "#" + replyid + "\"" + " class=\"post-reply-link\"" +
- " data-thread=" + "\"" + document.URL.match(/\d+/g)[1] + "\"" + " data-num=\"" + replyid + "\"" + ">" + ">>" + replyid + "</a><br>А ещё я сосу хуи.";
- }
- else{
- document.getElementById(postid).getElementsByTagName("blockquote")[0].innerHTML = "А ещё я сосу хуи.";
- }
- postid = "post-details-" + elements[i].id.match(/\d+/);
- document.getElementById(postid).innerHTML += "<checkedg></checkedg>"; // добавляем в конец тэг, чтобы скрипт не менял каждый раз одни и те же посты и не вызывал лаги
- }
- }
- }
- }, 500);
- $(document).ready(addJQuery(main));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement