您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Michał Białek znowu zepsuł mirko (⌐ ͡■ ͜ʖ ͡■) Wykop ❎ służy do wspomagania działania stylu "Wykop X", który jest wymagany do poprawnego działania niniejszego skryptu. Wykop X zainstaluj stąd: https://userstyles.world/style/8174/wykop-x
当前为
// ==UserScript== // @name Wykop ❎ dla Wykop.pl // @version 1.3.0 // @author SebastianDosiadłgo <[email protected]> // @author xXdeepfriedXx: "getObserveCount", "getTagsFingerPrint", "newAutoCompleteWindowAdded" - xXdeepfriedXx napisał funkcje pobierające z API wykopu liczbę obserwujących tagi podczas ich wpisywania! Podziękowania, za uzyczenie kodu. // @description Michał Białek znowu zepsuł mirko (⌐ ͡■ ͜ʖ ͡■) Wykop ❎ służy do wspomagania działania stylu "Wykop X", który jest wymagany do poprawnego działania niniejszego skryptu. Wykop X zainstaluj stąd: https://userstyles.world/style/8174/wykop-x // @namespace Violentmonkey Scripts // @match https://wykop.pl/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @require https://gf.qytechs.cn/scripts/383527-wait-for-key-elements/code/Wait_for_key_elements.js?version=701631 // @grant GM_addStyle // @license Copy anything you want // @license Każdy może skopiować dowolny fragment tego kodu i używać go do woli. Każdy oprócz użytkownika @browarek. // @license @browarek aka 'vocus' - który kradnie cudzy kod, a potem jest wulgarny i obraża, twierdząc, że wcale nic nie ukradł XD - nie może skopiować stąd nawet przecinka. // ==/UserScript== function countNumberOfNotificationsWithDelay() { setTimeout(function(){countNumberOfNotifications()}, 1000); } function countNumberOfNotifications() { $("header .right ul li.dropdown").removeClass("unread_5").removeClass("unread_4").removeClass("unread_3").removeClass("unread_2").removeClass("unread_1"); $("header .right ul li.dropdown:has(a.new)" ).each(function(index, value) { let numberOfNotifications = 0; // liczba powiadomień o tagach / wołaniach $(this).find(".notify:not(.read)" ).each(function(index, value) { ++numberOfNotifications; $(this).addClass(`unread_${numberOfNotifications}`); }).parents(`.notifications.dropdown`).addClass(`unread_${numberOfNotifications}`); }) $("header .right ul li.pm.dropdown:has(a.new)" ).each(function(index, value) { let numberOfNotifications = 0; // liczba powiadomień o wiadomościach PM $(this).find(".item.unread" ).each(function(index, value) { ++numberOfNotifications; $(this).addClass(`unread_${numberOfNotifications}`); }).parents(`.pm.dropdown`).addClass(`unread_${numberOfNotifications}`); console.log(`[Wykop X]: liczba nowych wiadomości: ${numberOfNotifications}`); }) } navigation.addEventListener('navigate', (event) => { countNumberOfNotificationsWithDelay()}); window.onload = function(event) { countNumberOfNotificationsWithDelay(); addWykopXButtonsToNavBar(); unrollDropdowns(); focusOnAddingNewMicroblogEntry(); }; function addWykopXButtonsToNavBar() { let $clone = $(`body header nav.main ul li:not(.active):not(:has(a[href="/wykopalisko"])):first`).clone(); let $cloneHits = $clone.clone(); let $cloneMyWykop = $clone.clone(); let $cloneAddNewEntry = $clone.clone(); let $cloneAddNewLink = $clone.clone(); let $cloneWykopWNowymStylu = $clone.clone(); let $cloneInstallWykopX = $clone.clone(); $cloneMyWykop.attr({class: "wykopx wykopx_mywykop_li"}).css("display","none").find("a").attr({ href: "/obserwowane", class: "wykopx wykopx_mywykop_button", title: "Mój Wykop :: przycisk dodany przez Wykop X"}).find("span").text("Mój Wykop"); $cloneHits.attr({class: "wykopx wykopx_hits_li"}).css("display","none").find("a").attr({href: "/hity", class: "wykopx wykopx_hits_button", title: "Hity :: przycisk dodany przez Wykop X"}).find("span").text("Hity"); $cloneAddNewLink.attr({class: "wykopx wykopx_add_new_link_li wykopx_plus_li"}).css("display","none").find("a").attr({href: "/dodaj-link", class: "wykopx wykopx_add_new_link wykopx_plus_button", title: `Dodaj nowe Znalezisko :: przycisk dodany przez Wykop X`}).find("span").text("+"); $cloneAddNewEntry.attr({class: "wykopx wykopx_add_new_entry_li wykopx_plus_li"}).css("display","none").find("a").attr({href: "/mikroblog/#dodaj", class: "wykopx wykopx_add_new_entry wykopx_plus_button", title: `Dodaj nowy wpis na Mirko :: przycisk dodany przez Wykop X`}).find("span").text("+"); $cloneWykopWNowymStylu.attr({class: "wykopx wykopx_wykopwnowymstylu_li"}).find("a").css("color","white").attr({href: "/tag/wykopwnowymstylu", class: "wykopx wykopx_wykopwnowymstylu_button", title: "Przejdź na #wykopwnowymstylu"}).find("span").text("#"); $cloneInstallWykopX.attr({class: "wykopx wykopx_install_wykopx_li"}).find("a").attr({href: "https://userstyles.world/style/8174/wykop-x", target: "_blank", class: "wykopx wykopx_install_wykopx_button", title: `Zainstaluj dodatek "Wykop X CSS" w rozszerzeniu Stylus i odkryj dziesiątki dodatkowych funkcji Wykopu`}).find("span").text("Zainstaluj Wykop X"); $cloneHits.insertAfter(`body header nav.main ul li:has(a[href="/wykopalisko"])`); $cloneAddNewLink.insertAfter(`body header nav.main ul li:has(a[href="/wykopalisko"])`); $cloneAddNewEntry.insertAfter(`body header nav.main ul li:has(a[href="/mikroblog"])`); $cloneMyWykop.appendTo(`body header nav.main ul`); $cloneInstallWykopX.appendTo(`body header nav.main ul`); $cloneWykopWNowymStylu.insertBefore(`body header nav .pm.dropdown`); } function focusOnAddingNewMicroblogEntry() { let hash = new URL(document.URL).hash; if(hash == "#dodaj") { document.querySelector(`section.microblog-page section.microblog section.editor div.content textarea`).focus(); } } // waitForKeyElements("section.stream div.content section.entry div.comments section.entry-subcomments div.content section.reply", sortCommentsByID); document.removeEventListener('click', this.documentClick) function unrollDropdowns(dropdown) { console.log("Wykop X :: unrollDropdowns") console.log(dropdown) document.removeEventListener('click', this.documentClick) } function sortCommentsByID(comment) { var commentID = comment.attr ("id").substr(8, 9); console.log(commentID); comment.css("order", commentID); } /* browarek programisto piekielny, przestań mi kurka kod prześladować! */ waitForKeyElements(".inline-autocomplete-stream", newAutoCompleteWindowAdded); const tagsAutocompleteURL = "https://wykop.pl/api/v3/tags/" const profilesAutocompleteURL = "https://wykop.pl/api/v3/profile/users/" function newAutoCompleteWindowAdded(element) { let suggestions = element[0].getElementsByTagName('span'); if (typeof this.lastFingerPrint == "undefined" || this.lastCount != suggestions.length || this.lastFingerPrint != getTagsFingerPrint(suggestions)) { for (let i = 0; i < suggestions.length; i++) { let suggestion = suggestions[i]; getObserveCount(suggestion); } } this.lastFingerPrint = getTagsFingerPrint(suggestions); this.lastCount = suggestions.length return true; } function getTagsFingerPrint(suggestions) { let fingerPrint = ''; for (let i = 0; i < suggestions.length; i++) { let suggestion = suggestions[i]; fingerPrint += suggestion.innerText.substring(1,).split(' ')[0]; } return fingerPrint; } function getObserveCount(element) { var type = element.innerText.substring(0,1); var query = element.innerText.substring(1,); var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var details = JSON.parse(this.responseText); addCount(type, element, details.data) } }; xmlhttp.open("GET", (type === '@' ? profilesAutocompleteURL : tagsAutocompleteURL) + query); xmlhttp.setRequestHeader("Authorization", "Bearer " + window.localStorage.token) xmlhttp.send(); } function addCount(prefix, element, data) { const name = (prefix === '@' ? data.username : data.name) const followers = (prefix === '@' ? data.summary.followers : data.followers) if(prefix != '@') { $(element) .parent() .attr({style: `order: ${ followers }`, "data-followers":`${ followers }`}) .html(`<div class="wykopx_autocomplete_element wykopx_autocomplete_tag"> <div class="wykopx_autocomplete_prefix">${ prefix }</div> <div class="wykopx_autocomplete_name">${ name }</div> <div class="wykopx_followers_counter">${ followers }</div> <meter class="wykopx_followers_meter" min="0" max="1000" low="99" high="500" optimum="999" value="${ followers }"></meter>`); } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址