3 ms·
hn_url := "http://hn.algolia.com/api/v1/" page := rand.Intn(50) points := randomInt(200, 600) url := hn_url + "search?tags=story&numericFilters=points>" +
by minimaxir 11y ago
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.
- bluerail 11y agoThe points is just a threshold to get a good article instead of just anything. And, Algolia returns maximum of 1000 hits for a query with 20 per page. So shuffling the page to pick up too.