rAthus

[UserScript] Discogs sort by price + shipping

Mar 10th, 2025 (edited)
725
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Discogs sort by price + shipping
  3. // @namespace    https://rAthus.com
  4. // @version      2025-12-10
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://www.discogs.com/sell/release*
  8. // @match        https://www.discogs.com/sell/list*
  9. // @match        https://www.discogs.com/sell/mywants*
  10. // @icon         https://www.google.com/s2/favicons?sz=64&domain=discogs.com
  11. // @grant        none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15.     'use strict';
  16.  
  17.     var w84jQuery = setInterval(function() {
  18.         if (typeof(jQuery)!='undefined') {
  19.             clearTimeout(w84jQuery);
  20.             var $ = jQuery;
  21.             $(document).ready(function() {
  22.                 setTimeout(function() {
  23.                     var $wrapper = $('table.mpitems');
  24.                     $wrapper.find('.shortcut_navigable ').sort(function(a,b) {
  25.                         var v1 = (($(a).find('.item_price .converted_price').text()||'').replace(',','').split('€')[1]||'').split(' ')[0]*1||0;
  26.                         var v2 = (($(b).find('.item_price .converted_price').text()||'').replace(',','').split('€')[1]||'').split(' ')[0]*1||0;
  27.                         return v1-v2;
  28.                     }).appendTo($wrapper);
  29.                     $wrapper.find('.price_header .link-text').html('Price + Shipping');
  30.                 },100);
  31.             });
  32.         }
  33.     },100);
  34. })();
Advertisement