Show HN: A HN Api to provide random HN posts to read upon

by bluerailon 7/13/2015, 3:49 AMwith 4 comments

by minimaxiron 7/13/2015, 6:23 AM

  hn_url := "http://hn.algolia.com/api/v1/"
  page := rand.Intn(50)
  points := randomInt(200, 600)
  url := hn_url + "search?tags=story&numericFilters=points>" + strconv.Itoa(points) + "&page=" + strconv.Itoa(page)
That's an odd definition of random.

by Killswitchon 7/14/2015, 2:12 AM

Not bad, but instead of displaying title and just url, maybe put HN url too, because I refreshed the endpoint a few times and got a couple self posts that had blank urls, but titles looked interesting...

Maybe at least if it's a self post, show the HN url.