brcha / Old battlefield on eRepublik

// ==UserScript==
// @name Old battlefield on eRepublik
// @description Select old battlefield by default
// @version 1.0.0
// @include http://erepublik.com/*
// @include http://*.erepublik.com/*
// @updateURL	https://openuserjs.org/install/brcha/Old_battlefield_on_eRepublik.user.js
// @downloadURL	https://openuserjs.org/install/brcha/Old_battlefield_on_eRepublik.user.js
// ==/UserScript==

var battlefieldUrls = document.evaluate("//a[contains(@href,'battlefield-new')]",
		document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = battlefieldUrls.snapshotLength - 1; i >= 0; i--)
{
	var elemLink = battlefieldUrls.snapshotItem(i);
	var hrefUrl = elemLink.href;
	var hrefOldUrl = hrefUrl.replace(/battlefield-new/, 'battlefield');
	elemLink.href = hrefOldUrl;
}