#Java Reddit API Wrapper
JRAW is currently in an experimental stage, and therefore subject to breaking API changes that could occur at any time.
##Notable Features
- OAuth2 support
- Full multireddit support
- All common actions (login, vote, submit, comment, messages, etc.)
- Java 7 compatible
- Simple HTTP framework capable of wrapping most any HTTP library
- Dynamic ratelimit adjustment
See Quickstart to get you up and running. Javadoc can be found here
##Building
JRAW uses Gradle as its build system. If you come from a Maven background, see Gradle's user guide to get you started.
gradle release
will generate four Jar files in build/releases
: a normal jar with just the library, a "fat" jar with all of JRAW's runtime dependencies, a Javadoc jar, and a sources jar. See here for an example.
gradle test
will run the unit tests
##Contributing
Before contributing, it is recommended that you have a decent knowledge of how the Reddit API works.
Some references:
- reddit/reddit's 'API' wiki page: Quick overview of the API and its rules
- reddit/reddit's 'JSON' wiki page: Shows the data structure of the objects returned by the API
- And of course, don't forget the official Reddit API documentation
####Want to contribute? Follow these steps:
- Fork the repository
- Put your testing user's credentials in
/src/test/java/resources/credentials.json
. It should be in this format. If you don't have a testing user, see below. - Add your code. Implement an endpoint, make the code prettier, or even just fix up some whitespace or documentation.
- Write TestNG tests covering your changes
- Test your code by executing
gradle test
- Update
ENDPOINTS.md
andEndpoints.java
by runninggradle endpoints:update
(see the wiki) - Send the pull request
####Creating a user for unit testing
The :testingUser
subproject is a script to help you get set up with JRAW. To run it, execute TERM=dumb gradle testingUser:run
. This script will:
- Register a new user
- Create an OAuth2 app
- Record the username, password, client ID, and client secret in
credentials.json
- Prompt you to create a subreddit (JRAW can't do this as of now)
- Create a multireddit
- Submit a self post to /r/jraw_testing2