Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. // ==UserScript==
  2. // @name AMZ colors count
  3. // @include /^https?://www\.amazon(\.com?)?\.[a-z]{2,3}/.*$/
  4. // @namespace /^https?://www\.amazon(\.com?)?\.[a-z]{2,3}/.*$/
  5. // ==/UserScript==
  6.  
  7. (function() {
  8. let selectNum = document.querySelectorAll("#native_dropdown_selected_color_name option").length - 45;
  9. if( document.querySelectorAll("#variation_color_name li").length == 0 ) {
  10. document.querySelector("#productTitle").innerHTML += "<div style='margin: 20px 0; font-size: 27px'><strong>Kolory:</strong> Za dużo o <strong><span style='color: #ff2b55'>" + selectNum + "</span></strong> kolory!!!11one</div>";
  11. } else {
  12. document.querySelector("#productTitle").innerHTML += "<div style='margin: 20px 0; font-size: 27px'><strong>Kolory:<span style='color: #ff2b55'> " + document.querySelectorAll("#variation_color_name li").length + "</span></strong></div>";
  13. }
  14. }())
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. // ==UserScript==
  28. // @name Item ID
  29. // @namespace http://www.ebay.de/
  30. // @include https://www.ebay.de/itm/*
  31. // ==/UserScript==
  32.  
  33. (function() {
  34. let img = document.querySelectorAll(".tdThumb img");
  35. let title = document.querySelector("#itemTitle");
  36. let src = img[1].getAttribute("src");
  37. src = src.match(/(\/\d{4}\/)/g).toString().replace(/\//g,'');
  38. title.innerHTML += '<span style="color: red; font-size: 110%"><strong> ' + src + '</strong></span>';
  39. }())
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. // ==UserScript==
  52. // @name Count Attr
  53. // @namespace https://www.ebay.de
  54. // @include https://www.ebay.de/itm/*
  55. // @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
  56. // ==/UserScript==
  57.  
  58. $( document ).ready(function() {
  59. let varNum = 0;
  60. let title = document.querySelector('#itemTitle');
  61. title.innerHTML += '<button name="submit" type="submit" id="submit">Ilość wariantów</button>';
  62.  
  63. $('#submit').click(function() {
  64. //PĘTLA PO WSZYSTKICH MODELACH Z LISTY
  65.  
  66. if($('body').hasClass('countedVariants') == false){
  67.  
  68. for(let i = 0; i <= unsafeWindow.$('#msku-sel-1 option').length - 2; i++) {
  69.  
  70. //WYBRANIE MODELU
  71. unsafeWindow.$('#msku-sel-1 option[value='+i+']').attr('selected','selected');
  72. unsafeWindow.$('#msku-sel-1 option[value='+i+']').change();
  73.  
  74. //DODANIE DO ZMIENNEJ ILOŚCI ROZMIARÓW Z MODELU
  75. varNum += unsafeWindow.$('#msku-sel-2 option').length - 1;
  76. }
  77.  
  78. //WYCZYSZCZENIE WYBORU
  79. unsafeWindow.$('#msku-sel-1 option[value=-1]').attr('selected','selected');
  80. unsafeWindow.$('#msku-sel-1 option[value=-1]').change();
  81.  
  82. //WYPISANIE WYLICZONEJ WARTOŚCI
  83. document.querySelector('#submit').innerHTML += ' ' + varNum;
  84. $('body').addClass('countedVariants');
  85. }
  86. });
  87. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement