Open MdKaif2782 opened 2 years ago
would be a a great feature!
I think you can achieve this by passing the category ( top/hot/rising/new ) to the URL
like:
func GetSubredditAPIURL(subreddit string, limit int, category string) (url string) {
url = "https://oauth.reddit.com/r/" + subreddit + "/"+category+"?limit=" + strconv.Itoa(limit)
return
}
and you also need to add this new information to the cache
like:
memes := redis.GetPostsFromCache(sub+category)
if err := redis.WritePostsToCache(sub+category, freshMemes); err != nil {
sentry.CaptureException(err)
}
Using your Butter Smooth API for my discord bot.. Really a big help! But the problem is its showing same posts for 2-3 times (specially for specified subreddit). It would be really good if it can be specified that by which sorting method a random meme will be generated like sort by Hot/new/Rising/Top/Gilded etc..