And I guess I should share it for the people who'd like to do the same and have some javascript-knowledge.
First: I have FireBug/FireQuery installed, and add jQuery to the page (though it isn't strictly necessary, I'm too lazy to do it differently)
Then I execute my code in the console:
Code: Select all
reserve = function(games) {
for (var i = 0; i < games.length; i++) {
var game = games[i];
for (var j = 0; j < game.players.length; j++) {
name = game.players[j];
jQuery.ajax({
async: false,
url:"player.php?submit=Reserve",
data:{game:game.nr,username:name},
type:"POST",
success: function(html) {
console.log(game.nr);
}
});
}
}
}
var games = [{nr:7584984, players:["Commander62890","perchorin","jrh_cardinal","Krissan"]},
{nr:7584985, players:["Risk_Averse","Aalmeida17","Cognac","Squirly"]},
{nr:7584986, players:["Nesterdude","SirSebstar","Sherkaner","Shoop76"]},
{nr:7584987, players:["StevieQ","caymanmew","I_AM_BOGEY","Woolleyy"]},
{nr:7584988, players:["patrickaa317","HMSPS","Edgron","skillfusniper33"]},
{nr:7584989, players:["Yojimbo28","Mudpuppy","hwhrhett","shaneback"]},
{nr:7584992, players:["Risky_stud","pepperjack","bjf5893","drunkmonkey"]}];
reserve(games);
I think a script could be made for inviting from this base, but you'd have to be careful about the restrictions.
After that I even thought I should be able to fetch the names etc. from google docs. Same mechanism of executing, except that you have to be on the page:
Code: Select all
String.prototype.trim = function() {
return this.replace(/^\s+|\s+$/g, '');
};
var games = [];
var column = 13;
var row = 67;
var waffle = jQuery("#2-grid-table-quadrantscrollable tr");
for (var i = 0; i < 6; i++) {
var start = row + 4 * i;
var gameNr = waffle.eq(start).find("td").eq(column + 1).html().trim();
for (var j = 0; j < 4; j++) {
var player1 = waffle.eq(start).find("td").eq(column).html().trim();
var player2 = waffle.eq(start + 1).find("td").eq(column).html().trim();
var player3 = waffle.eq(start + 2).find("td").eq(column).html().trim();
var player4 = waffle.eq(start + 3).find("td").eq(column).html().trim();
}
games.push({
nr: gameNr,
players:[player1,player2,player3,player4]
});
}
JSON.stringify(games);
https://spreadsheets.google.com/ccc?key ... l=en#gid=2 (3rd tab if this doesn't lead there directly)
if you're curious how it looked exactly. And then you'll see that I started doing this after I sent out 8*32 manually...
