Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global refactoring. Improved maintainability. #11

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

yvasyliev
Copy link

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);
    }
}

@yvasyliev yvasyliev changed the title Global refactoring. Improves maintainability. Global refactoring. Improved maintainability. Sep 1, 2022
@masecla22
Copy link
Owner

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!

# Conflicts:
#	src/main/java/masecla/reddit4j/client/Reddit4J.java
#	src/main/java/masecla/reddit4j/objects/RedditComment.java
@yvasyliev yvasyliev reopened this Sep 9, 2022
@yvasyliev
Copy link
Author

Fixed the confilcts. Probably it's a good option to create a separate branch to merge all these changes.

@martinformi
Copy link

Any progress on this? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants