Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Share with HN: Bookmarklet to graph HN polls
25 points by bouncingsoul on July 12, 2009 | hide | past | favorite | 4 comments
I made a bookmarklet that makes a simple bar graph for HN polls. Nothing fancy, but it makes interpreting polls here way easier for me.

Tested in Safari and Firefox.

Make a new bookmark with the following location:

  javascript:(function(cells){var%20totalPoints=0;for(var%20i=0;i<cells.length;i++){if(cells[i].className==%22default%22){totalPoints+=parseInt(cells[i].textContent.match(/^[0-9]+/),10);}}for(i=0;i<cells.length;i++){if(cells[i].className==%22default%22){var%20optionPoints=parseInt(cells[i].textContent.match(/^[0-9]+/),10);cells[i].setAttribute(%22style%22,%22padding-left:.25em;border-left:%22+(optionPoints/totalPoints)*500+%22px%20solid%20#dcb;%22);}}})(document.getElementsByTagName(%22table%22)[3].getElementsByTagName(%22td%22));


Wow, this is awesome! Tested it on http://news.ycombinator.com/item?id=692672 if you need a quick test subject. Worked really well. (+1 for fitting in with the color scheme.)


screenshot for the unmotivated: http://timfreeman.org/pollgraph.png


Nice work. Should be the default IMO.


Good job. This would also work well as a Greasemonkey script.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: