您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Pozwala zgłosić znalezisko bez tagu #polityka
// ==UserScript== // @name Politics Reporter // @version 1.0 // @description Pozwala zgłosić znalezisko bez tagu #polityka // @author Dreszczyk // @match https://www.wykop.pl/* // @grant none // @namespace https://greasyfork.org/users/29486 // ==/UserScript== const runPoliticsReporter = () => { window.reportPolitics = (id) => { // https://www.wykop.pl/ajax/violations/form/link/3877561 $.ajax({ method: "GET", url: "https://www.wykop.pl/ajax/violations/form/link/" + id, }).done(function( data ) { const returnForm = $(data.html).find('form')[0]; const actionURL = $(returnForm).attr('action'); const tags = $(returnForm).find('#reason35').attr('data-extravalue') + ' #polityka'; const violation = { 'violation[reason]': '35', 'violation[info]': tags, 'violation[object_type]': 'link', 'violation[object_id]': id, }; $.ajax({ type: "POST", url: actionURL, data: $.param(violation), }).done(function(data) { // callback hell ;( const button = $('.reportButton' + id); if(data[0] === true) { button.text('OK!'); } else { button.text('Błąd'); } }); }); }; console.log('1.0'); const linksList = document.querySelectorAll("#itemsStream .link.iC > .article.dC:not(.empty-media)"); linksList.forEach((link) => { const buttonHandle = link.querySelectorAll('time'); if(buttonHandle.length) { const linkID = link.getAttribute('data-id'); buttonHandle[0].insertAdjacentHTML('afterend', '<span class="tag affect create reportButton' + linkID + '" onClick="reportPolitics(' + linkID + ');" style="margin-left: 20px; border: 1px solid rgba(100, 100, 100, 0.3);">brak tagu #polityka</span>'); } }); }; runPoliticsReporter();