All Projects → mattbdean → Jraw

mattbdean / Jraw

Licence: mit
The Java Reddit API Wrapper

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Jraw

Praw
PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
Stars: ✭ 2,675 (+735.94%)
Mutual labels:  api, reddit-api, oauth, reddit
Shreddit
Remove your comment history on Reddit as deleting an account does not do so.
Stars: ✭ 669 (+109.06%)
Mutual labels:  reddit-api, oauth, reddit
aPRAW
Asynchronous Python Reddit API Wrapper
Stars: ✭ 49 (-84.69%)
Mutual labels:  oauth, reddit, reddit-api
Social Amnesia
Forget the past. Social Amnesia makes sure your social media accounts only show your posts from recent history, not from "that phase" 5 years ago.
Stars: ✭ 656 (+105%)
Mutual labels:  api, reddit-api, reddit
Twitch4j
Modular Async/Sync/Reactive Twitch API Client / IRC Client
Stars: ✭ 209 (-34.69%)
Mutual labels:  api, gradle, oauth
Psraw
PowerShell Reddit API Wrapper
Stars: ✭ 42 (-86.87%)
Mutual labels:  api, reddit-api, reddit
node-express-reddit-clone
Build a Node, Express and MySQL-based clone of Reddit for DecodeMTL web development bootcamp
Stars: ✭ 28 (-91.25%)
Mutual labels:  reddit, reddit-api
reddit-image-fetcher
A JavaScript package for fetching reddit images, memes, wallpapers and more.
Stars: ✭ 40 (-87.5%)
Mutual labels:  reddit, reddit-api
saveddit
Bulk Downloader for Reddit
Stars: ✭ 130 (-59.37%)
Mutual labels:  reddit, reddit-api
cronnit.com
A free tool for scheduling posts to Reddit.
Stars: ✭ 3 (-99.06%)
Mutual labels:  reddit, reddit-api
rreddit
𝐫⟋ Get Reddit data
Stars: ✭ 49 (-84.69%)
Mutual labels:  reddit, reddit-api
redditwatcher
📻 Reddit streaming CLI
Stars: ✭ 17 (-94.69%)
Mutual labels:  reddit, reddit-api
crypto-subreddits-cli
👽 Track Cryptocurrency Subreddits On The Command Line 👽
Stars: ✭ 24 (-92.5%)
Mutual labels:  reddit, reddit-api
Reaper
Social media scraping / data collection tool for the Facebook, Twitter, Reddit, YouTube, Pinterest, and Tumblr APIs
Stars: ✭ 240 (-25%)
Mutual labels:  api, reddit
roux
Simple and (a)synchronous Reddit API wrapper for Rust.
Stars: ✭ 41 (-87.19%)
Mutual labels:  reddit, reddit-api
ARAW
The Android Reddit API Wrapper
Stars: ✭ 75 (-76.56%)
Mutual labels:  reddit, reddit-api
Mongit
💾 Mongo-esque Reddit-based Database!
Stars: ✭ 20 (-93.75%)
Mutual labels:  reddit, reddit-api
Updoot
A reddit client built for android
Stars: ✭ 51 (-84.06%)
Mutual labels:  oauth, reddit
Devise token auth
Token based authentication for Rails JSON APIs. Designed to work with jToker and ng-token-auth.
Stars: ✭ 3,263 (+919.69%)
Mutual labels:  api, oauth
Hwioauthbundle
OAuth client integration for Symfony. Supports both OAuth1.0a and OAuth2.
Stars: ✭ 2,150 (+571.88%)
Mutual labels:  api, oauth
The Java Reddit API Wrapper

travis-ci build status Latest release Kotlin 1.2.41 API coverage Codecov branch

repositories {
    jcenter()
}
dependencies {
    implementation "net.dean.jraw:JRAW:$jrawVersion"
}

Documentation

The full documentation is available on GitBooks, but here's a sneak peek:

// Assuming we have a 'script' reddit app
Credentials oauthCreds = Credentials.script(username, password, clientId, clientSecret);

// Create a unique User-Agent for our bot
UserAgent userAgent = new UserAgent("bot", "my.cool.bot", "1.0.0", "myRedditUsername");

// Authenticate our client
RedditClient reddit = OAuthHelper.automatic(new OkHttpNetworkAdapter(userAgent), oauthCreds);

// Get info about the user
Account me = reddit.me().about();

Javadoc

JRAW uses JitPack to host its Javadoc.

https://jitpack.io/com/github/mattbdean/JRAW/VERSION/javadoc/index.html

VERSION can be a specific commit hash (like d6843bf), a tag (like v1.0.0), or the HEAD of a branch (like master-SNAPSHOT).

JitPack produces Javadoc only when necessary, so the first time someone accesses the Javadoc for a specific build it may take a little bit.

Android

JRAW doesn't target Android specifically, but there is an extension library that solves some quality of life issues. Also be sure to check out the example app that shows how to get users logged in.

Contributing

To get started you'll need to create two reddit OAuth2 apps, one script and one installed, and then create a subreddit.

To have this done automatically for you, run this command:

$ ./gradlew :meta:credentials --no-daemon --console plain

Your testing account should have at least 100 karma, otherwise you'll run into issues when trying to create a subreddit.

lib/src/test/resources/credentials.json:

{
    "script": {
        "username": "...",
        "password": "...",
        "clientId": "...",
        "clientSecret": "..."
    },
    "app": {
        "clientId": "...",
        "redirectUrl": "..."
    },
    "moderationSubreddit": "..."
}

Then you can go ahead and run the tests

$ ./gradlew test

Tests are written with Spek and assertions are done with Expekt.

In order to get the integration tests of the docs module to pass, you'll need 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.

Code Style

Kotlin code follows the official conventions provided by JetBrains (with a few exceptions).

A few hard and fast rules:

  • UTF-8 everywhere
  • 4 spaces for indentation
  • 120 line length

Releasing

Define these variables in gradle.properties:

# Go to gitbook.com -> Account Settings -> Applications/Tokens to get an API key
gitbookUsername=<gitbook username>
gitbookPassword=<gitbook API key or password>

# Go to bintray.com -> Edit Profile -> API Key to get your account's API key
bintrayUser=<bintray username>
bintrayKey=<bintray API key>

# If this property doesn't match the target release, all release-related tasks
# will be disabled
authorizeRelease=<version to release>

Update the version in the root build.gradle and then run the :lib:release task to perform a release.

$ ./gradlew release --no-daemon --console plain

This task will:

  1. Clean everything and run :lib's tests
  2. Run :meta:update (see here for what this does)
  3. Creates a commit for the version. This commit must be pushed manually later.
  4. Updates the GitBook site and creates a new tag in the Git repo.
  5. Uploads artifacts (sources, Javadoc, and compiled) to Bintray

After running the task:

  1. Push the newly-created commit
  2. Create a GitHub release targeting that commit. Attach all jars generated in lib/build/libs.
  3. Publish the uploaded jars on Bintray
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].