How do I use WWWform and JSON to login to reddit?

I want to be able to let users connect with their reddit accounts in my game and I have been doing a bit of research. I came across this tutorial for reddit login with python and I noticed it was a bit like using the WWWform in Unity to send data.

The python tutorial also used JSON to read the information that was sent back, I think? I then found some info on JSON for Unity and found this MiniJSON script.

So basically I was wondering if this is all the stuff I need to use to login to reddit? Also for the MiniJSON script, when it says “using MiniJSON;” on line 5 does that mean it is using the MiniJSON.cs script that they linked at the bottom of their post?

I’ve never logged into Reddit before, but, looking at the links in your question, yes, that looks to be all you need to log in through script. The using MiniJSON; does mean the code in the MiniJSON.cs script is used/needed.

One word of advice. I’d strongly urge that you experiment logging into Reddit using a tool like Poster, before you try to do this from Unity. Poster is an add-in to Firefox that lets you make GET/POST/PUT/etc requests to a remote site, and shows the (often) xml response. Poking the Reddit REST API this way will teach you all you need to know about the API. Once you know what URLs to hit, what headers are needed, and what can go wrong, you’ll be all set to do this from Unity. If you dive straight into Unity you’ll not know if any problems are due to Unity, or how you’re accessing Reddit.