Open nindalf opened 4 years ago
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.
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?
Sorry if the previous comments weren't clear about this - I'm happy to implement this feature.
I think this would be helpful to add. @gobanos , what do you think?