Coder Social home page Coder Social logo

Add subcommand to submit solution about cargo-aoc HOT 3 OPEN

nindalf avatar nindalf commented on September 1, 2024 1
Add subcommand to submit solution

from cargo-aoc.

Comments (3)

gobanos avatar gobanos commented on September 1, 2024

Should be quite easy to implement, and we already open a browser tab for criterion results, so it should be possible to open the puzzle page after submission.

from cargo-aoc.

nindalf avatar nindalf commented on September 1, 2024

I think that might not even be necessary. When I tried to implement this, I figured it would be easier to store the result of cargo aoc in a file, and submit that value in a POST. We'd then parse the returned HTML to let the user if they got it right or not.

        let post_data = format!{"{{\"answer\": {}, \"level\": {}}}", solution, part.as_u8()};

        let mut response = client
            .post(&date.submit_url()) //  "https://adventofcode.com/{}/day/{}/answer",
            .body(post_data)
            .header(COOKIE, formated_token)
            .send()?;

I noticed the repo is undergoing some refactoring. Is that complete?

from cargo-aoc.

nindalf avatar nindalf commented on September 1, 2024

Sorry if the previous comments weren't clear about this - I'm happy to implement this feature.

from cargo-aoc.

Related Issues (20)

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.