Anaphase / reddit-stream

A NodeJS module that provides a constant stream of reddit posts and comments.
4 stars 2 forks source link

Support multiple subreddits #3

Open webmutation opened 7 years ago

webmutation commented 7 years ago

Is there a way to get events from multiple subreaddits pass an array in

new RedditStream('posts', [subredditA, subredditB, subredditC]);

Anaphase commented 7 years ago

Hmm, that would be quite useful indeed. Unfortunately I'm using raw.js here to perform the requests to retrieve comments and I don't think it supports multiple subreddits like that, and that's probably because reddit's API doesn't really support it either. There's the concepts of multireddits, but I'm not sure you can really query those in the same way as normal reddits ¯\_(ツ)_/¯

webmutation commented 7 years ago

I found a way but requires the creation of a scheduler to make the requests... since there is a limit of 60 request per minute... I just take a list and schedule fetch in the closest interval... I don't know coffescript otherwise I would have extended your solution. Its not perfect but works for now.