Skip to content

Instantly share code, notes, and snippets.

@xshyamx
Created March 15, 2013 06:01
Show Gist options
  • Save xshyamx/5167782 to your computer and use it in GitHub Desktop.
Save xshyamx/5167782 to your computer and use it in GitHub Desktop.
Create a wordle from stackoverflow.com/tags
fm = document.createElement('form');
fm.action = 'http://www.wordle.net/compose';
fm.method = 'post';
document.body.appendChild(fm);
ta = document.createElement('textarea');
ta.name = 'wordcounts';
fm.appendChild(ta);
ta.appendChild(document.createTextNode(
[].map.call(
document.querySelectorAll('.tag-cell'),
function(v) {
var k = v.querySelector('.post-tag').innerHTML,
vl = v.querySelector('.item-multiplier-count').innerHTML;
var x = [k.replace(/<[^>]*>/, ''), vl];
return x[0] + ':' + x[1];
}).join(',')
));
fm.submit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment