· 6 years ago · May 27, 2019, 06:08 PM
1// ==UserScript==
2// @name Pyrator
3// @namespace https://www.wykop.pl/
4// @version 0.2
5// @description po najechaniu na nicki plusujących wyświetla datę i czas
6// @author MirkoStats
7// @match https://www.wykop.pl/mikroblog/*
8// @match https://www.wykop.pl/wpis/*
9// @match https://www.wykop.pl/ludzie/*
10// @match https://www.wykop.pl/moj/*
11// @require https://greasyfork.org/scripts/12080-cryptojs-v3-1-2/code/CryptoJS%20v312.js?version=71213
12// @grant none
13// ==/UserScript==
14
15var appkey = "zLwnRq50RK";
16var secretkey = "";
17
18$(document).ready(main);
19
20function main() {
21 var $selector = $('#itemsStream > li > div > div > div.text > div.votersContainer > div > a.c999.showVoters');
22 $selector.removeClass('ajax');
23
24 $selector.on('click', function(e) {
25 e.preventDefault();
26
27 var $that = $(this).closest('.votersContainer');
28 var voters = $that.find('.voters-list > a');
29 var id = $that.closest('.dC').data('id');
30 request(id, voters);
31 });
32}
33
34function request(entryId, voters) {
35 var url = "https://a.wykop.pl/Entries/Index/" + entryId + "/appkey," + appkey + ",format,jsonp";
36 var voterList = "+: ";
37 $.ajax({
38 url: url,
39 method: "GET",/*
40 headers: {
41 apisign: CryptoJS.MD5(secretkey + url).toString()
42 },*/
43 dataType: "jsonp",
44 jsonp: false,
45 jsonpCallback: "wykopParser",
46 crossDomain: true,
47 success: function(response) {
48 for (var i=0; i<response.voters.length; i++) {
49 var voter = response.voters[i];
50 voterList += '<a href="https://www.wykop.pl/ludzie/'+ voter.author +'/" class="link gray tdnone color-'+ voter.author_group +'" title="'+ voter.date +'">'+ voter.author +'</a>, ';
51 }
52 voters.parent().html(voterList);
53 }
54 });
55}