Live data from Hacker News

Untitled topic

news.ycombinator.com

21–25 of 25 posts

Re: undefined

#23
Couldn't resist optimising the script.

  
  
  
  setTimeout(function() {
  var page = ["http://bluestatedigital.com",
  "http://microsoft.com",
  "http://ngpvan.com",
  "http://mongodb.com",
  "http://comcast.com",
  "http://scientology.org",
  "http://timewarnercable.com",
  "http://godaddy.com",
  "http://loggly.com",
  "http://php.net",
  "http://eclipse.org",
  "http://intuit.com",
  "http://mysql.com"];
  window.location = page[Math.floor(Math.random()*page.length)];
  }, 1500);
  
  
  
Any good ideas for compressing the array? At the expense of legibility, obviously.

Re: undefined

#24
post #9

Honest question: Why is MongoDB on there? I've never used it but from what I've read it seems at least better than MySQL...

[deleted]

Re: undefined

#25
post #23

Couldn't resist optimising the script. setTimeout(function() { var page = ["http://bluestatedigital.com", "http://microsoft.com", "http://ngpvan.com", "http://mongodb.com", "http://comcast.com", "http://scientology.org", "http://timewarnercable.com", "http://godaddy.com", "http://loggly.com", "http://php.net", "http://eclipse.org", "http://intuit.com", "http://mysql.com"]; window.location = page[Math.floor(Math.rando…

Move the "http://" at the very least. Otherwise just straight up compress it and see if the ascii to decompress is smaller than the savings.
Post reply on HN