Skip to content

Instantly share code, notes, and snippets.

@gosub
Created December 24, 2017 16:37
Show Gist options
  • Save gosub/ef6b57ae372e028dd7d59c5a74970918 to your computer and use it in GitHub Desktop.
Save gosub/ef6b57ae372e028dd7d59c5a74970918 to your computer and use it in GitHub Desktop.
Hacker News 3 years ago
var t = new Date();
var y = t.getFullYear();
var m = t.getMonth();
var d = t.getDate();
var p1 = (new Date(y-3, m, d, 0,0,0,0).getTime() + "").slice(0,-3);
var p2 = (new Date(y-3, m, d, 23,59,0,0).getTime() + "").slice(0, -3);
var u = "https://hn.algolia.com/?query=&sort=byPopularity&prefix&page=0&dateRange=custom&type=story&dateStart=" + p1 + "&dateEnd="+ p2;
window.location.href=u;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment