Demonoid Auto Sort By Seeds

By JoeSimmons Last update Nov 8, 2008 — Installed 2,309 times. Daily Installs: 1, 0, 1, 0, 1, 0, 0, 0, 2, 3, 0, 5, 0, 4, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0

There are 3 previous versions of this script.

// ==UserScript==
// @name           Demonoid Auto Sort By Seeds
// @namespace      http://userscripts.org/users/23652
// @description    Automatically sorts results by seeds
// @include        http://www.demonoid.com/files/*
// @copyright      JoeSimmons
// ==/UserScript==

function addSortInput() {
var s = document.evaluate("//input[@name='sort']", document, null, 9, null).singleNodeValue;
if(s) {s.value = "S";}
}

if(/\/files\/.+category=.+$/.test(location.href) && !/(\&|\?)sort=S/.test(location.href)) {
location.href = location.href.replace(/\&sort=(\w+)?/g, '') + '&sort=S';
}

window.addEventListener("load", addSortInput, false);