Aktywne Wpisy
banzi +140
Poznajcie nową Miss Alabama.
https://www.dailymail.co.uk/news/article-13502991/plus-size-miss-alabama-sara-milliken-responds-cyberbullying.html
https://www.dailymail.co.uk/news/article-13502991/plus-size-miss-alabama-sara-milliken-responds-cyberbullying.html
Tumurochir +167
Widzę, że niestety #nowywykop dodał
()[]
dookoła linki w codeblock.. trzeba będzie usuwać i zostawić tylko linki jak chcecie skorzystać (╯°□°)╯︵ ┻━┻EDIT: lepiej będzie przez link.. https://pastebin.com/raw/RzixnvXf
#userscript #greasemonkey #tampermonkey #wykopchangelog
// ==UserScript==
// @name Wykop 2.0 AutoCompleteFollowerCount
// @namespace [https://wykop.pl/ludzie/xXdeepfriedXx](https://wykop.pl/ludzie/xXdeepfriedXx)
// @version 1.0
// @description Add the amount of followers to the autocomplete window
// @Author xXdeepfriedXx
// @Match *.wykop.pl/*
// @Icon [https://www.google.com/s2/favicons?sz=64&domain=wykop.pl](https://www.google.com/s2/favicons?sz=64&domain=wykop.pl)
// @grant none
// @require [http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js](http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js)
// @require [https://gist.github.com/raw/2625891/waitForKeyElements.js](https://gist.github.com/raw/2625891/waitForKeyElements.js)
// ==/UserScript==
waitForKeyElements(".inline-autocomplete-stream", newAutoCompleteWindowAdded);
const tagsAutocompleteURL = "[https://wykop.pl/api/v3/tags/"](https://wykop.pl/api/v3/tags/")
const profilesAutocompleteURL = "[https://wykop.pl/api/v3/profile/users/"](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(type, element, data) {
const name = (type === '@' ? data.username : data.name)
const followers = (type === '@' ? data.summary.followers : data.followers)
element.innerText = `${type}${name} (${followers})`;
}
https://greasyfork.org/en/scripts/458860-wykop