NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Favorileyenleri Engelle // @namespace - // @version 0.2 // @description Engelle geç! // @author - // @match https://eksisozluk.com/* // @require http://crypto.stanford.edu/sjcl/sjcl.js // @grant GM_getValue // @grant GM_deleteValue // @grant GM_setValue // @grant GM_registerMenuCommand // @license MIT // ==/UserScript== //Password mechanism: https://stackoverflow.com/a/15269327/7132421 var encKey = GM_getValue("encKey", ""); var usr = GM_getValue("lognUsr", ""); var pword = GM_getValue("lognPwd", ""); var token = "tkn"; if (!encKey) { encKey = Math.random().toString(36).substring(7); GM_setValue("encKey", encKey); usr = pword = ""; } usr = decodeOrPrompt(usr, "Kullanıcı Adı", "lognUsr"); pword = decodeOrPrompt(pword, "Şifre", "lognPwd"); function decodeOrPrompt(targVar, userPrompt, setValVarName) { if (targVar) { targVar = unStoreAndDecrypt(targVar); } else { targVar = prompt( userPrompt + ' girilmeli:', '' ); GM_setValue(setValVarName, encryptAndStore(targVar)); } return targVar; } function encryptAndStore(clearText) { return JSON.stringify(sjcl.encrypt(encKey, clearText)); } function unStoreAndDecrypt(jsonObj) { return sjcl.decrypt(encKey, JSON.parse(jsonObj)); } GM_registerMenuCommand("Kullanıcı adını değiştir", changeUsername); GM_registerMenuCommand("Şifreyi değiştir", changePassword); function changeUsername() { promptAndChangeStoredValue(usr, "Kullanıcı Adı", "lognUsr"); } function changePassword() { promptAndChangeStoredValue(pword, "Şifre", "lognPwd"); } function promptAndChangeStoredValue(targVar, userPrompt, setValVarName) { targVar = prompt( 'Yeni ' + userPrompt + ':', targVar ); GM_setValue(setValVarName, encryptAndStore(targVar)); } $.post("https://api.eksisozluk.com/token", { grant_type: "password", username: usr, password: pword, client_secret: "6cba2458-6fa8-4c55-8d72-78620542e43d" }) .fail(function () { alert("Kullanıcı adı ya da şifre hatalı"); GM_deleteValue("lognUsr"); GM_deleteValue("lognPwd"); location.reload(); }) .done(function (data) { token = data.access_token; }); (function () { 'use strict'; setInterval(function () { if (!~$('body').html().indexOf("F.Engelle")) { $('.feedback').each(function (index, value) { let num = $(this).next().find(".entry-date").attr("href").split('/')[2]; $(this).append("<a onclick='favEng(" + num + ")' style='font-size:" + $('.entry-author').css("font-size") + ";color:" + $('.entry-author').css("color") + "!important'> F.Engelle</a>"); $(this).append("<a onclick='thisEng(\"" + $(this).next().find('.entry-author').text() + "\")' style='font-size:" + $('.entry-author').css("font-size") + ";color:" + $('.entry-author').css("color") + "!important'> Engelle</a>"); }); } }, 2000); unsafeWindow.favEng = function (num) { $.get('https://eksisozluk.com/entry/favorileyenler?entryId=' + num + '&_=' + Date.now(), function (data) { var users = []; $(data).find('a').each(function () { if ($(this).attr('href').split('/')[1] == "biri") users.push($(this).attr('href').split('/')[2]); else { $.get('https://eksisozluk.com' + $(this).attr('href'), function (data) { $(data).find('a').each(function () { users.push($(this).attr('href').split('/')[2]); }); if (confirm("Aşağıdakiler başlıklarıyla beraber engellensin mi?\n" + users.join("\n"))) { justDo(users); } }); } }) }); } unsafeWindow.thisEng = function (user) { var users = []; users.push(user); if (confirm("Aşağıdakiler başlıklarıyla beraber engellensin mi?\n" + users.join("\n"))) { justDo(users); } } function justDo(users) { $.each(users, function (index, value) { $.get('https://eksisozluk.com/biri/' + value, function (data) { $(data).find('.relation-link').each(function () { if (~$(this).data("add-caption").indexOf("başlıklarını engelle")) $.post('https://eksisozluk.com' + $(this).data("add-url")); }); }); fetch('https://api.eksisozluk.com/v1/user/' + encodeURI(value).replace(/-/g, "%20") + '/block', { method: 'get', headers: new Headers({ 'Authorization': 'bearer ' + token, }) }); sleep(75); }); } function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds) { break; } } } })();