Closed mz2212 closed 7 years ago
You can already do this! Harvests from listings just return the content at the endpoint. For a subreddit, the endpoint only offers posts. See the comment endpoint.
harvest, _ := bot.Listing("/r/bottesting/comments", "")
for _, comment := range harvest.Comments[:30] {
// process comments
}
These comments will be flat and in reverse chronological order; if you want the tree structure of comments you'll need to use the post harvest and then request each thread individually to get the comment trees.
Also note that the posts from "/r/subreddit" endpoints in harvests do not contain their replies, as that data isn't part of the listing. You would need to call Thread() to get the replies.
What I had in mind:
What you currently have to do to access them doesn't work exactly. (Or at least I can't figure it out. I'm not sure if I'm doing it wrong.)