Advertisement
Guest User

Untitled

a guest
May 26th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. // @require      https://greasyfork.org/scripts/12080-cryptojs-v3-1-2/code/CryptoJS%20v312.js?version=71213
  11. // @grant        none
  12. // ==/UserScript==
  13.  
  14. var appkey = "zLwnRq50RK";
  15. var secretkey = "";
  16.  
  17. $(document).ready(main);
  18.  
  19. function main() {
  20.     var $selector = $('#itemsStream > li > div > div > div.text > div.votersContainer > div > a.c999.showVoters');
  21.     $selector.removeClass('ajax');
  22.  
  23.     $selector.on('click', function(e) {
  24.         e.preventDefault();
  25.  
  26.         var $that = $(this).closest('.votersContainer');
  27.         var voters = $that.find('.voters-list > a');
  28.         var id = $that.closest('.dC').data('id');
  29.         request(id, voters);
  30.     });
  31. }
  32.  
  33. function request(entryId, voters) {
  34.     var url = "https://a.wykop.pl/Entries/Index/" + entryId + "/appkey," + appkey + ",format,jsonp";
  35.     var voterList = "+: ";
  36.     $.ajax({
  37.         url: url,
  38.         method: "GET",/*
  39.         headers: {
  40.             apisign: CryptoJS.MD5(secretkey + url).toString()
  41.         },*/
  42.         dataType: "jsonp",
  43.         jsonp: false,
  44.         jsonpCallback: "wykopParser",
  45.         crossDomain: true,
  46.         success: function(response) {
  47.             for (var i=0; i<response.voters.length; i++) {
  48.                 var voter = response.voters[i];
  49.                 voterList += '<a href="https://www.wykop.pl/ludzie/'+ voter.author +'/" class="link gray tdnone color-'+ voter.author_group +'" title="'+ voter.date +'">'+ voter.author +'</a>, ';
  50.             }
  51.             voters.parent().html(voterList);
  52.         }
  53.     });
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement