sis.link.sortByPostTime

sort threads by post time

질문, 리뷰하거나, 이 스크립트를 신고하세요.
  1. // ==UserScript==
  2. // @name sis.link.sortByPostTime
  3. // @namespace zhang
  4. // @description sort threads by post time
  5. // @include http://www.sexinsex.net/*
  6. // @include http://www.sis001.com/*
  7. // @version 1
  8. // @grant GM_log
  9. // ==/UserScript==
  10.  
  11. var links = document.getElementsByTagName('A')
  12. for (var i = 0; i < links.length; i++) {
  13. var link = links[i];
  14. var href = link.href;
  15. if (href.indexOf('/forumdisplay.php?') >= 0) {
  16. if (href.indexOf('&orderby=') < 0) {
  17. href += '&orderby=dateline';
  18. }
  19. if (href.indexOf('&ascdesc=') < 0) {
  20. href += '&ascdesc=DESC';
  21. }
  22. if (link.href!=href) {
  23. link.href = href;
  24. }
  25. } else if (href.indexOf('/forum-') >= 0) {
  26. href = href.replace(/\/forum-(\d+)-(\d+)\.html/, "/forumdisplay.php?fid=$1&filter=0&orderby=dateline&ascdesc=DESC&page=$2")
  27. link.href = href;
  28. }
  29. }