Advertisement
rAthus

[UserScript] Discogs sort by price + shipping

Mar 10th, 2025
193
0
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-10
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://www.discogs.com/sell/release/*
  8. // @icon         https://www.google.com/s2/favicons?sz=64&domain=discogs.com
  9. // @grant        none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13.     'use strict';
  14.  
  15.     $(document).ready(function() {
  16.         setTimeout(function() {
  17.             var $wrapper = $('table.mpitems');
  18.             $wrapper.find('.shortcut_navigable ').sort(function(a,b) {
  19.                 var v1 = ($(a).find('.item_price .converted_price').text()||'').split('€')[1].split(' ')[0]*1||0;
  20.                 var v2 = ($(b).find('.item_price .converted_price').text()||'').split('€')[1].split(' ')[0]*1||0;
  21.                 return v1-v2;
  22.             }).appendTo($wrapper);
  23.             $wrapper.find('.price_header .link-text').html('Price + Shipping');
  24.         },1000);
  25.     });
  26. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement