Giter VIP home page Giter VIP logo

codingame-puzzles-stats-library's Introduction

Maven Central Coverage Maintainability Rating GitHub Actions Javadoc

CodinGame Puzzles stats library GitHub

Simple library for interacting with CodinGame's puzzle API.

How to integrate the CodinGame-Puzzles-Stats-library into your code

Required Java version : 17

Maven

If you have Maven, add the following to the dependencies of your pom.xml file:

<dependency>
  <groupId>io.github.mathieusoysal</groupId>
  <artifactId>codingame-puzzles-stats</artifactId>
  <version>1.0.5</version>
</dependency>

See an example of a pom.xml file with the CodinGame-Puzzles-stats-library

Gradle

If you are using Gradle, add the following to the dependencies of your build.gradle file:

    implementation 'io.github.mathieusoysal:codingame-puzzles-stats:1.0.5'

Example code for using the CodinGame-Puzzles-Stats library

import com.github.mathieusoysal.codingame_stats.puzzle.Puzzle;
import com.github.mathieusoysal.codingame_stats.puzzle.achievement.Achievement;
import com.github.mathieusoysal.codingame_stats.puzzle.topic.Topic;
import com.github.mathieusoysal.codingame_stats.CodinGame;

public class CodeExemple {

    public static void main(String[] args) {
        CodinGame codinGame = new CodinGame();

        // Get all puzzles of CodinGame
        List<Puzzle> puzzles = codinGame.getPuzzles();

        // Iterate over all puzzles
        for (Puzzle puzzle : puzzles) {
            // Print the title of the puzzle
            System.out.println(puzzle.getTitle());

            // Print the solved count of the puzzle
            System.out.println(puzzle.getSolvedcount());

            // Print the attempt count of the puzzle
            System.out.println(puzzle.getAttemptCount());

            // Print the achievement count of the puzzle
            System.out.println(puzzle.getAchievementCount());

            // Print the xp points of the puzzle
            System.out.println(puzzle.getXpPoints());

            // Print the created date of the puzzle
            System.out.println(puzzle.getCreatedDate());

            // Print the title of the puzzle
            System.out.println(puzzle.getTitle());

            // Print the contributor of the puzzle
            System.out.println(puzzle.getContributor());

            // Print the topics of the puzzle
            for (Topic topic : puzzle.getTopics()) {
                System.out.println(topic.getHandle());
                System.out.println(topic.getValue());
            }

            // Print the achievements of the puzzle
            for (Achievement achievement : puzzle.getLinkedAchievements()) {
                System.out.println(achievement.getTitle());
                System.out.println(achievement.getDescription());
                System.out.println(achievement.getPoints());
                System.out.println(achievement.getLevel());
            }

        }

    }
}

See more code exemples

Contribution

Suggestions and contributions are always welcome! Please discuss larger changes via an issue before submitting a request.

Licence

This project is released under the GNU General Public License v3.0

codingame-puzzles-stats-library's People

Contributors

dependabot[bot] avatar mathieusoysal avatar

Watchers

 avatar  avatar

codingame-puzzles-stats-library's Issues

Found finished puzzle

Description :
With the CodinGame API, add the ability to find user information about the puzzle.

Exemple :

String userId = "The user id";
Puzzles puzzles = codinGame.getPuzzles(userId);
puzzles.get(0).getDoneAchievementCount();
puzzles.get(0).getValidatorScore();

Bug to retrieve data

Introduction

The CodinGame has been updated, and the current version of this project doesn't work with the new CodinGame API.

Log of errors

Error:  Tests run: 107, Failures: 0, Errors: 11, Skipped: 0
[INFO] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Skipping CodinGame Puzzles Stats
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  11.320 s
[INFO] Finished at: 2022-12-06T02:07:30Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project codingame-puzzles-stats: There are test failures.
Error:  
Error:  Please refer to /home/runner/work/CodinGame-Puzzles-stats-library/CodinGame-Puzzles-stats-library/target/surefire-reports for the individual test results.
Error:  Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
Error:  -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Error: Process completed with exit code 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.