Open TimvdLippe opened 6 years ago
Or maybe use random over just the top n days feed?
Yes that is possible as well. We probably can take the week? https://api.reddit.com/r/autistentoren/top?t=week seems to work and gives back 7 results (only 7 new posts this week). In that case, we can still do the post-filtering with the randomness factor I think.
We would thus retrieve (at most) 25 top posts of a subreddit and then randomly select based on the post score.
Sounds good!
Right now, the selection is purely
random
, per the implementation of https://hubot.github.com/docs/scripting/#random This thus leads to the potential selection of sub-par posts. Instead, we should give a higher probability to posts with a lot of points. E.g. the probability of a post to be selected should bepost.weight / sum(post.weight)
.