How would I go about getting the new posts of a subreddit in JSON? Just tacking on .json to the url (http://www.reddit.com/r/SOME_SUBREDDIT/new.json) returns the following:
{ kind: "Listing" - data: { modhash: "" children: [ ] after: null before: null } }
The children array doesn't contain any posts. I've come to find that http://www.reddit.com/r/SOME_SUBREDDIT/new actually routes to new?sort=rising when what I need is new?sort=new.
and /new?sort=new.json of course wont work.
The .json
modifier should be put at the end of the path component, not the entire URL. The URL you're looking for is:
http://www.reddit.com/r/subreddit/new.json?sort=new
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With