Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which REST endpoints are being called by the subreddit.stream.comments()? #1057

Closed
vgoklani opened this issue Apr 30, 2019 · 1 comment
Closed

Comments

@vgoklani
Copy link

I would like to replicate the subreddit.stream.comments() method via directly calling the Reddit REST API. Which endpoints are you using to synthesize the subreddit.stream.comments() stream? What about the subreddit.stream.submissions? Thanks!

@jarhill0
Copy link
Contributor

Subreddit.stream.comments() makes requests to https://oauth.reddit.com/r/[subreddit]/comments/ and performs some logic on it (checking which posts have already been yielded). You can see the logic for that here, but be aware that there are open PRs and Issues having to do with changing this (#1025, #1043, #1050).

Subreddit.stream.submissions() makes requests to https://oauth.reddit.com/r/[subreddit]/new.

I found this information by using the snippet from Logging in PRAW and then making the requests. It prints output like

Fetching: GET https://oauth.reddit.com/r/[subreddit]/new
Data: None
Params: {'before': None, 'limit': 99, 'raw_json': 1}
Response: 200 (2324 bytes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants