(Shake, Shake, Shake) Shuffle Your Tumblr Queue

Shuffling the Tumblr post Queue has been a standard feature of Missing e for some time now but for those who, like me, don’t want to install Missing e, you can use the very simple little script below.

Navigate to your Tumblr Queue (tumblr.com/blog/blogname/queue) and execute the following script:

var dm = document.querySelectorAll('.post_control.move_to_top');
var rs = [ ];

for (var i = 0, j; i < dm.length; i++) {
	j = Math.random() * (i + 1) | 0;
	(j !== i) && (rs[i] = rs[j]);
	rs[j] = dm[i];
}

rs.map(Function.prototype.call.bind(HTMLElement.prototype.click));

It is an implementation of the “inside-out” Fisher–Yates shuffle. It will simulate clicking the move to top link in a shuffled manner over the queued posts.

It can be used more easily as a bookmarklet.