Lurker News
Paste the following into the console of any HN page - for annotated avatars on all HN comments. (self contained code)

  for(u of document.querySelectorAll('.hnuser'))for(u.prepend(c=document.createElement('canvas')),x=c.getContext('2d'),c.width=18,c.height=14,s=u.innerText,r=1,i=28+s.length;i--;i<28?r>>>29>X*X/3+Y/2&&x.fillRect(6+2*X,2*Y,2,2)&x.fillRect(6-2*X,2*Y,2,2):r+=s.charCodeAt(i-28,x.fillStyle='#'+(r>>8&0xFFFFFF).toString(16)))r^=r<<13,r^=r>>>17,r^=r<<5,X=i&3,Y=i>>2

Comments (493) 108 threads

Earlier comments
mettamage#
Fun showcase, but truthfully I would not want this to become a permanent feature. A browser plugin would work.
kizer#
As others mentioned, you could add to the plethora of HN browser extensions. Another idea would be to allow people to specify an avatar in their bio and load it in, though that would entail a lot of web requests I guess. Also, I just realized that it's not random... wow!
nautilus501 reply#
Cool! Works on mobile, too. Prepend "javascript:" to the code and enter on search bar.
Normille#
Not working for me on mobile. I tried both the extension and the greasemonkey script ???

Load more comments