-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparams.json
1 lines (1 loc) · 5.63 KB
/
params.json
1
{"name":"jReddit","tagline":"Java wrapper for Reddit API","body":"jReddit\r\n=====\r\n\r\n[![Build Status](https://travis-ci.org/jReddit/jReddit.png?branch=master)](https://travis-ci.org/jReddit/jReddit)\r\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.jreddit/jreddit/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.github.jreddit/jreddit)\r\n[![Coverage Status](https://coveralls.io/repos/jReddit/jReddit/badge.svg)](https://coveralls.io/r/jReddit/jReddit)\r\n\r\n### What is jReddit?\r\njReddit is a wrapper for the Reddit API written in Java. Project started by Omer Elnour. Taken over for further development and maintainence by [Karan Goel](http://www.goel.im).\r\n### How to use jReddit?\r\nAt the moment, jReddit can be included in your project using:\r\n\r\n#### Maven\r\n```\r\n<dependency>\r\n <groupId>com.github.jreddit</groupId>\r\n <artifactId>jreddit</artifactId>\r\n <version>1.0.3</version>\r\n</dependency>\r\n```\r\n\r\n#### Gradle\r\n```\r\ndependencies {\r\n compile group: 'com.github.jreddit', name: 'jreddit', version: '1.0.3'\r\n}\r\n```\r\n### What can it do?\r\njReddit can login with a user, retrieve user information, submit new links, and vote/comment on submissions, send and receive messages and notifications among other things.\r\n\r\n### Examples\r\n\r\nConnect a user\r\n```java\r\n// Initialize REST Client\r\nRestClient restClient = new HttpRestClient();\r\nrestClient.setUserAgent(\"bot/1.0 by name\");\r\n\r\n// Connect the user \r\nUser user = new User(restClient, \"username\", \"password\");\r\ntry {\r\n\tuser.connect();\r\n} catch (Exception e) {\r\n\te.printStackTrace();\r\n}\r\n```\r\n\r\nRetrieve top 100 submissions of /r/programming\r\n\r\n```java\r\n// Handle to Submissions, which offers the basic API submission functionality\r\nSubmissions subms = new Submissions(restClient, user);\r\n\r\n// Retrieve submissions of a submission\r\nList<Submission> submissionsSubreddit = subms.ofSubreddit(\"programming\", SubmissionSort.TOP, -1, 100, null, null, true);\r\n\r\n```\r\n\r\nSubmit a link and self post\r\n\r\n```java\r\n\r\n// Handle to SubmitActions, which offers the basic API functionality to submit comments and posts\r\nSubmitActions submitActions = new SubmitActions(restClient, user);\r\n\r\n// Submit a link\r\nsubmitActions.submitLink(\r\n \"Oracle V Google judge is a programmer!\",\r\n \"http://www.i-programmer.info/news/193-android/4224-oracle-v-google-judge-is-a-programmer.html\",\r\n \"programming\");\r\n \r\n// Submit a self post\r\nsubmitActions.submitSelfPost(\"What's the difference between a duck?\",\r\n \"One of its legs are both the same!\", \"funny\");\r\n```\r\n\r\nSend a message to another user\r\n\r\n```java\r\nimport com.github.jreddit.message.Messages;\r\nimport com.github.jreddit.user.User;\r\n\r\n/**\r\n * @author Karan Goel\r\n */\r\npublic class ComposeTest {\r\n\r\n public static void main(String[] args) {\r\n User user = null;\r\n String recipientUsername = \"other_user\";\r\n try {\r\n user = new User(\"username\", \"password\"); // Add your username and password\r\n user.connect();\r\n } catch (Exception exception) {\r\n exception.printStackTrace();\r\n }\r\n\r\n new Messages().compose(user, recipientUsername, \"this is the title\", \"the message\", \"\", \"\");\r\n }\r\n}\r\n```\r\n\r\n# Possibility to configure RestClient\r\n### Normal instantiation\r\n\r\nThere are 2 implementation at the moment for ```RestClient```\r\n\r\n* ```HttpRestClient```\r\n* ```PoliteHttpRestClient``` *recommended RestClient since Reddit API has a limitation to make only 1 request every 2 seconds.*\r\n\r\n### Through RestClientFactory\r\n\r\nFactory and utility class to easily instantiate ```RestClient```.\r\nAvailable methods:\r\n\r\n* ```newHttpRestClient()```\r\n* ```newHttpRestClient(HttpClient)```\r\n* ```newPoliteHttpRestClient()```\r\n* ```newPoliteHttpRestClient(HttpClient)```\r\n* ```newProxyHttpClient(hostname, port)```\r\n* ```newProxyHttpClient(hostname, port, scheme)```\r\n\r\n### Other examples\r\n## Java \r\nYou can find other examples [here](https://github.com/karan/jReddit/tree/master/src/main/java/examples)\r\n## Android\r\nYou can find a small example of how to integrate jReddit in an Android application [here](https://github.com/jReddit/jReddit/tree/master/examples/Jreddit-sample-project)\r\n\r\n\r\n### What's next for jReddit?\r\nThe plan is to implement every feature documented [here](http://www.reddit.com/dev/api). To see which methods have been implemented, and which have not, see [this file](https://github.com/karan/jReddit/blob/master/implemented_methods.md).\r\n\r\n### How to contribute?\r\nPersonally, I would suggest reading through the source code to understand the general structure and standards used. Then check the [implemented_methods.md](https://github.com/karan/jReddit/blob/master/implemented_methods.md) file to see which methods have not yet been implemented. Choose the ones you'd like to contribute to. After you write the method (and maybe commit it?), write a test to see if it works fine and as expected. Then make sure other tests are working too and your code does not break anty other method.\r\n\r\nSend in a pull request with the test and I'll be happy to merge! :-)\r\n\r\n### Dependencies\r\n1. [JSON-simple](http://code.google.com/p/json-simple/)\r\n\r\n2. [Apache HttpComponents](https://hc.apache.org/)\r\n\r\n3. [Apache Commons IO](https://commons.apache.org/proper/commons-io/)\r\n","google":"UA-62944961-1","note":"Don't delete this file! It's used internally to help with page regeneration."}