Sales history sorter - hcpao.org

5/30/2023, 7:56:47 PM

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/467532/1198876/Sales%20history%20sorter%20-%20hcpaoorg.js

  1. // ==UserScript==
  2. // @name Sales history sorter - hcpao.org
  3. // @namespace Violentmonkey Scripts
  4. // @match *://*.hcpao.org/Search/Parcel/*
  5. // @include *://hcpao.org/Search/Parcel/*
  6. // @grant none
  7. // @version 1.3
  8. // @author Ryan McLean
  9. // @description 5/30/2023, 7:56:47 PM
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. const salesHistoryTable = $("h3:contains('Sales History')").next().first('table').find('tbody');
  14. const salesHistoryRows = salesHistoryTable.find("tr");
  15.  
  16. const extractBookPageValue = (tableRow) => Number($(tableRow).find("td:eq(0):first-child").text() + $(tableRow).find("td:eq(1):first-child").text());
  17.  
  18. const SortByBookPageDesc = (a, b) => {
  19. var a_value = extractBookPageValue(a);
  20. var b_value = extractBookPageValue(b);
  21.  
  22. if (a_value > b_value)
  23. return -1;
  24. else if (a_value < b_value)
  25. return 1;
  26. else
  27. return 0;
  28. }
  29.  
  30. salesHistoryRows.sort(SortByBookPageDesc).appendTo(salesHistoryTable);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址