Advertisement
rAthus

[UserScript] Discogs sort by price + shipping

Mar 10th, 2025 (edited)
372
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-03-12
  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. // @icon         https://www.google.com/s2/favicons?sz=64&domain=discogs.com
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14.     'use strict';
  15.  
  16.     var w84jQuery = setInterval(function() {
  17.         if (typeof(jQuery)!='undefined') {
  18.             clearTimeout(w84jQuery);
  19.             var $ = jQuery;
  20.             $(document).ready(function() {
  21.                 setTimeout(function() {
  22.                     var $wrapper = $('table.mpitems');
  23.                     $wrapper.find('.shortcut_navigable ').sort(function(a,b) {
  24.                         var v1 = (($(a).find('.item_price .converted_price').text()||'').split('€')[1]||'').split(' ')[0]*1||0;
  25.                         var v2 = (($(b).find('.item_price .converted_price').text()||'').split('€')[1]||'').split(' ')[0]*1||0;
  26.                         return v1-v2;
  27.                     }).appendTo($wrapper);
  28.                     $wrapper.find('.price_header .link-text').html('Price + Shipping');
  29.                 },100);
  30.             });
  31.         }
  32.     },100);
  33. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement