{"id":15288356,"url":"https://github.com/mattbdean/jraw","last_synced_at":"2025-04-05T10:08:39.336Z","repository":{"id":16999400,"uuid":"19762540","full_name":"mattbdean/JRAW","owner":"mattbdean","description":"The Java Reddit API Wrapper","archived":false,"fork":false,"pushed_at":"2021-11-21T19:28:15.000Z","size":6910,"stargazers_count":357,"open_issues_count":37,"forks_count":128,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-05T10:08:33.133Z","etag":null,"topics":["api","gradle","java","oauth","reddit","reddit-api"],"latest_commit_sha":null,"homepage":"https://mattbdean.gitbooks.io/jraw","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattbdean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-14T01:51:42.000Z","updated_at":"2025-04-02T22:19:41.000Z","dependencies_parsed_at":"2022-08-09T17:40:13.359Z","dependency_job_id":null,"html_url":"https://github.com/mattbdean/JRAW","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattbdean%2FJRAW","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattbdean%2FJRAW/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattbdean%2FJRAW/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattbdean%2FJRAW/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattbdean","download_url":"https://codeload.github.com/mattbdean/JRAW/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","gradle","java","oauth","reddit","reddit-api"],"created_at":"2024-09-30T15:47:54.492Z","updated_at":"2025-04-05T10:08:39.313Z","avatar_url":"https://github.com/mattbdean.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://raw.githubusercontent.com/mattbdean/JRAW/master/art/header.png\" alt=\"The Java Reddit API Wrapper\" /\u003e\n\n[![travis-ci build status](https://img.shields.io/travis/mattbdean/JRAW.svg)](https://travis-ci.org/mattbdean/JRAW)\n[![Latest release](https://img.shields.io/github/release/mattbdean/JRAW.svg)](https://bintray.com/thatjavanerd/maven/JRAW/_latestVersion)\n[![Kotlin 1.2.41](https://img.shields.io/badge/Kotlin-1.2.41-blue.svg)](http://kotlinlang.org)\n[![API coverage](https://img.shields.io/badge/API_coverage-49%25-9C27B0.svg)](https://github.com/thatJavaNerd/JRAW/blob/master/ENDPOINTS.md)\n[![Codecov branch](https://img.shields.io/codecov/c/github/mattbdean/JRAW.svg)](https://codecov.io/gh/mattbdean/JRAW)\n\n```groovy\nrepositories {\n    jcenter()\n}\ndependencies {\n    implementation \"net.dean.jraw:JRAW:$jrawVersion\"\n}\n```\n\n## Documentation\n\nThe full documentation is available [on GitBooks](https://mattbdean.gitbooks.io/jraw), but here's a sneak peek:\n\n```java\n// Assuming we have a 'script' reddit app\nCredentials oauthCreds = Credentials.script(username, password, clientId, clientSecret);\n\n// Create a unique User-Agent for our bot\nUserAgent userAgent = new UserAgent(\"bot\", \"my.cool.bot\", \"1.0.0\", \"myRedditUsername\");\n\n// Authenticate our client\nRedditClient reddit = OAuthHelper.automatic(new OkHttpNetworkAdapter(userAgent), oauthCreds);\n\n// Get info about the user\nAccount me = reddit.me().about();\n```\n\n### Javadoc\n\nJRAW uses JitPack to host its Javadoc.\n\n```\nhttps://jitpack.io/com/github/mattbdean/JRAW/VERSION/javadoc/index.html\n```\n\n`VERSION` can be a specific commit hash (like [`d6843bf`](https://jitpack.io/com/github/mattbdean/JRAW/d6843bf/javadoc/index.html)), a tag (like [`v1.0.0`](https://jitpack.io/com/github/mattbdean/JRAW/v1.0.0/javadoc/index.html)), or the HEAD of a branch (like [`master-SNAPSHOT`](https://jitpack.io/com/github/mattbdean/JRAW/master-SNAPSHOT/javadoc/index.html)).\n\nJitPack produces Javadoc only when necessary, so the first time someone accesses the Javadoc for a specific build it may take a little bit.\n\n## Android\n\nJRAW doesn't target Android specifically, but there is an [extension library](https://github.com/mattbdean/JRAW-Android) that solves some quality of life issues. Also be sure to check out the [example app](https://github.com/mattbdean/JRAW-Android/tree/master/example-app) that shows how to get users logged in.\n\n## Contributing\n\nTo get started you'll need to create two [reddit OAuth2 apps](https://www.reddit.com/prefs/apps), one script and one installed, and then create a subreddit.\n\nTo have this done automatically for you, run this command:\n\n```sh\n$ ./gradlew :meta:credentials --no-daemon --console plain\n```\n\nYour testing account should have at least 100 karma, otherwise you'll run into issues when trying to create a subreddit.\n\n`lib/src/test/resources/credentials.json`:\n\n```json\n{\n    \"script\": {\n        \"username\": \"...\",\n        \"password\": \"...\",\n        \"clientId\": \"...\",\n        \"clientSecret\": \"...\"\n    },\n    \"app\": {\n        \"clientId\": \"...\",\n        \"redirectUrl\": \"...\"\n    },\n    \"moderationSubreddit\": \"...\"\n}\n```\n\nThen you can go ahead and run the tests\n\n```sh\n$ ./gradlew test\n```\n\nTests are written with [Spek](http://spekframework.org/) and assertions are done with [Expekt](https://github.com/winterbe/expekt).\n\nIn order to get the integration tests of the `docs` module to pass, you'll need [gitbook-cli](https://github.com/GitbookIO/gitbook-cli) installed globally. You shouldn't have to worry about this, as most of the contributions are likely to be towards the core library and not its accessory modules.\n\n### Code Style\n\nKotlin code follows the [official conventions](https://kotlinlang.org/docs/reference/coding-conventions.html) provided by JetBrains (with a few exceptions).\n\nA few hard and fast rules:\n\n - UTF-8 everywhere\n - 4 spaces for indentation\n - 120 line length\n\n## Releasing\n\nDefine these variables in `gradle.properties`:\n\n```properties\n# Go to gitbook.com -\u003e Account Settings -\u003e Applications/Tokens to get an API key\ngitbookUsername=\u003cgitbook username\u003e\ngitbookPassword=\u003cgitbook API key or password\u003e\n\n# Go to bintray.com -\u003e Edit Profile -\u003e API Key to get your account's API key\nbintrayUser=\u003cbintray username\u003e\nbintrayKey=\u003cbintray API key\u003e\n\n# If this property doesn't match the target release, all release-related tasks\n# will be disabled\nauthorizeRelease=\u003cversion to release\u003e\n```\n\nUpdate the version in the root [build.gradle](https://github.com/mattbdean/JRAW/blob/master/build.gradle) and then run the `:lib:release` task to perform a release.\n\n```\n$ ./gradlew release --no-daemon --console plain\n```\n\nThis task will:\n\n 1. Clean everything and run `:lib`'s tests\n 2. Run `:meta:update` (see [here](https://github.com/mattbdean/JRAW/tree/master/meta) for what this does)\n 3. Creates a commit for the version. This commit must be pushed manually later.\n 4. Updates the GitBook site and creates a new tag in the Git repo.\n 5. Uploads artifacts (sources, Javadoc, and compiled) to [Bintray](https://bintray.com/thatjavanerd/maven/JRAW)\n\nAfter running the task:\n\n 1. Push the newly-created commit\n 2. Create a [GitHub release](https://github.com/mattbdean/JRAW/releases/new) targeting that commit. Attach all jars generated in `lib/build/libs`.\n 3. Publish the uploaded jars on [Bintray](https://bintray.com/thatjavanerd/maven/JRAW)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattbdean%2Fjraw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattbdean%2Fjraw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattbdean%2Fjraw/lists"}