#Java Reddit API Wrapper
JRAW is currently in an experimental stage, and therefore subject to breaking API changes that could occur at any time.
Quick Note: Due to the fact that the unit tests rely on a solid internet connection and that the reddit API is working properly, a failing build does not necessarily mean that the library is currently unstable. For example, this build failed because reddit was having issues with SSL at the time. JRAW tries its best to recover from server errors, but it can only do so much.
##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
Here's how to create a testing user:
- Register a new user
- Create an OAuth2 app
- Record the username, password, client ID, and client secret in
src/test/java/resources/credentials.json
- Create a subreddit
- Create a multireddit
- Submit a self post to /r/jraw_testing2