Excess GMail invites? Script them away!

Automated disclaimer: This post was written more than 15 years ago and I may not have looked at it since.

Older posts may not align with who I am today and how I would think or write, and may have been written in reaction to a cultural context that no longer applies. Some of my high school or college posts are just embarrassing. However, I have left them public because I believe in keeping old web pages alive—and it's interesting to see how I've changed.

Amazingly, people are still looking for free GMail invites. (You'd think there'd be enough floating around, but apparently not.) There are several sites that accept invites and spool them back out to anyone who asks, my favorite of which is ByteTest. Sending invite after invite to ginvites@xn0.org is not my idea of fun, but I still like the anonymizing effect of the spooler, and I wanted to help. So, I hacked together a clod of javascript to automate the process.

I present here the base code, which works in Mozilla Firefox 1.5. If you remove all the line breaks, you can enter it the FireBug console while at the address https://mail.google.com/.

var spooler = 'ginvites@xn0.org';
var waitTime = 1000;
var frames = document.getElementsByTagName("frame");
var main = undefined;
for(var i=0; i<frames.length; i++)
	if(frames[i].getAttribute('name') === 'main') 
		main = frames[i];
var inmain = main.contentDocument;
var v1frame = inmain.getElementById('v1');
var invitebox = v1frame.contentDocument.getElementById('nvi');
var inviter = invitebox.getElementsByTagName('form')[0];
var addybox = v1frame.contentDocument.getElementById('if');
var addysend = v1frame.contentDocument.getElementById('ib');
var lefttext = addysend.nextSibling.nextSibling.firstChild.nodeValue;
var matches = /[0-9]+/.exec(lefttext);
var remaining = (matches.length > 0 ? matches[0] : 0);
function chainOne(left)
	addybox.value = spooler;
	setTimeout(function(){chainOne(left-1)}, waitTime);

I can't figure out how to make this into a bookmarklet, though. I tried wrapping it in the standard bookmarklet code:

void(function(){ /*code goes here*/ }())

...and it would only send one invite, then stop without errors. If anyone can figure it out, please let me know! I'd like to present this as an easy-to-use bookmarklet.

I will delete on sight any comments asking for invites. Go wait in line at ByteTest.com like everyone else.

Responses: 1 so far Feed icon

  1. Pim&#8217;s page • News &raquo; archief &raquo; Gmail invites doneren says:

    [...] Wij hebben een javascript code gemaakt, waarmee je makkelijker Gmail invites kunt doneren aan ons. Deze code in gebasseerd op de code gemaakt door Tim McCormack. [...]

Self-service commenting is not yet reimplemented after the Wordpress migration, sorry! For now, you can respond by email; please indicate whether you're OK with having your response posted publicly (and if so, under what name).