It’s been a while since I wrote the last one, but a user on reddit asked how to get OAuth working with Imgur, and I couldn’t resist giving it one more shot. Thanks to my recent experience with the Netflix API, even though it was in C# rather than in Python, I was able to wrangle a quick and easy script for getting started.
What’s up? Today we’re going to look at how to retrieve the stories (official term for submissions or selfposts) from any given subreddit. What we’re going to do is pretty simple, essentially just customizing a url with the proper subreddit and reading the JSON object returned. It’s going to be a pretty short one. I’m going to attach the login code I’ve written along with the code we’ve looked at today so that you can just copy and paste it into your IDE and start playing with it, right away. Just make sure you’ve got all the required module installed, mentioned here. Hit the jump to get started!
Reddit is hiring! Unfortunately I’m not sure I’m qualified, since I’m not familiar with how the Web works, from a behind the scenes stand point, but I’m interested in at least trying to tackle their dev challenge, which is to create an app that matches redditors together based on some preference for shipping internationally or not, and then create a list with a unique ID, their country, and the shipping preference. Definitely seems doable.
They’ve set some very clear goals, as well as some great guidelines as to what response they want, which makes our life a lot easier. After the jump is the entire job spec, for later use, or as a backup.