Reddit4J
Reddit4J copied to clipboard
Global refactoring. Improved maintainability.
In this PR I completely rewrote the codebase, renamed packages and classes.
I created few entities and API methods. Since there is no complete official Reddit API documentation, I don't think I can finish the work by myself. But I think it's a good start to finally write a stable version.
Here is a quickstart example:
public class Example {
public static void main(String[] args) throws IOException {
PersonalUseScript personalUseScript = new PersonalUseScript(
"app_id",
"secret"
);
UserAgent userAgent = new UserAgent(
"app_name",
"version",
"author"
);
Credentials credentials = new Credentials(
"login",
"password"
);
RedditClient redditClient = new RedditClient(new ScriptClientConfig(
personalUseScript,
userAgent,
credentials
));
User me = redditClient.getMe().execute();
System.out.println(me);
PreferenceSettings myPreferences = redditClient.getMyPreferences().execute();
System.out.println(myPreferences);
myPreferences.setLang("es");
myPreferences = redditClient.setMyPreferences().setPreferences(myPreferences).execute();
System.out.println(myPreferences);
}
}
Do you mind having a look over why there's some conflicts?
I've had a look over your architecture, and I feel like it is really good, and we could really implement it.
With the library being pretty much experimental, there's no worry for backwards compatibility!
Fixed the confilcts. Probably it's a good option to create a separate branch to merge all these changes.
Any progress on this? :)