Live data from Hacker News

Poll: Where do you live?

news.ycombinator.com

71–80 of 563 posts

Re: Poll: Where do you live?

#72
post #36
post #25

Pasting this in dev console will give you a quick and dirty rundown. It sorts locations by points. [...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)).map(a => a.join(' - ')) As of this post, California is leading, followed by other places w/ large tech hubs (Germany, UK, Canada, NY, Washington)

This is begging for a console.table console.table([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))

Current top 10:

  'US: California' '79 points'
  'Canada' '48 points'
  'US: Washington' '39 points'
  'US: New York' '36 points'
  'Germany' '35 points'
  'United Kingdom' '34 points'
  'US: Massachusetts' '19 points'
  'Netherlands' '18 points'
  'US: Colorado' '17 points'
  'Sweden' '16 points'
Colorado #9? Really?

Re: Poll: Where do you live?

#75
post #60
post #36

Earlier quoted context omitted.

This is begging for a console.table console.table([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))

Neat! Noob question: is there a similar way to dump it to JSON, instead of a table?

Just replace console.table with JSON.stringify for the quick-and-easy dump of exactly the same data as is in the table...

JSON.stringify([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))

Re: Poll: Where do you live?

#76
post #60
post #36

Earlier quoted context omitted.

This is begging for a console.table console.table([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))

Neat! Noob question: is there a similar way to dump it to JSON, instead of a table?

Replace `console.table` with `JSON.stringify`:

JSON.stringify([...document.querySelectorAll('.fatitem table .athing')].map(el => [el.textContent.trim(), el.nextSibling.textContent.trim()]).sort(([,a], [,b]) => parseInt(b) - parseInt(a)))

Re: Poll: Where do you live?

#77

Why does America get states and UK doesn't get England, Wales, Scotland and Northern Ireland?

OP wanted to prove that HN isn't Silicon Valley-centric and instead showed their bias toward US-centrism :)

The more pervasive bias is to think countries are the best way to carve reality at its joints.

Re: Poll: Where do you live?

#79
post #57
post #49

There were similar polls in 2013. We could compare against those to measure tech dispersal over the last decade! - "Poll: Where are you currently living?" (Countries, 2013) https://news.ycombinator.com/item?id=6582647 - "Poll: If you're in the US, What State Do You Live In?" (US states, 2013) https://news.ycombinator.com/item?id=5222370

I'd like to see these votes divided by the total population of each place

Every geographic survey is just a population heat map result or something

https://xkcd.com/1138/

Post reply on HN