Advertisement
PsiAmp

Rezka ratings userscript

Feb 6th, 2022
1,234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name     Rezka
  3. // @version  1
  4. // @include      https://rezka.ag/*
  5. // @grant        GM_getValue
  6. // @grant        GM_setValue
  7. // @grant        GM_deleteValue
  8. // @grant        GM_listValues
  9. // @grant        GM_addValueChangeListener
  10. // @grant        GM_openInTab
  11. // @grant        GM_xmlhttpRequest
  12. // @grant        GM.getValue
  13. // @grant        GM.setValue
  14. // @grant        GM.deleteValue
  15. // @grant        GM.listValues
  16. // @grant        GM.openInTab
  17. // @grant        GM.xmlHttpRequest
  18. // @run-at       document-end
  19. // @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
  20. // ==/UserScript==
  21.  
  22. run();
  23.  
  24. function run() {
  25.   console.log("-------- Greasing Rezka -------------");
  26.   var all = $(document).find('.b-content__inline_item');
  27.  
  28.   $.each(all, function(index, element){
  29.     var id = element.getAttribute('data-id');
  30.  
  31.     setTimeout(function() {
  32.       try {
  33.         $.ajax({
  34.           url: '/engine/ajax/quick_content.php',
  35.           data: {
  36.             id: id,
  37.             is_touch: 1
  38.           },
  39.           type: 'POST',
  40.           cache: !1,
  41.           dataType: 'html'
  42.         }).always(function (response) {
  43.           var html = $('<div id="bubble-content-' + id + '" class="b-content__bubble"><div class="b-content__bubble_content">' + response + '</div>' + '<i class="arrow"><i></i></i></div>');
  44.           if (html.length == 0)
  45.             return;
  46.  
  47.           var rates_div = $(html[0]).find('.b-content__bubble_rates');
  48.           if (rates_div.length == 0)
  49.             return;
  50.  
  51.           element.append(rates_div[0]);
  52.         })
  53.       } catch (e) {
  54.         console.error(e);
  55.       }      
  56.     }, index * 150 + index * 10);
  57.    
  58.   });
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement