-
Notifications
You must be signed in to change notification settings - Fork 7
Add the possibility to fetch the input directly from the AoC website #16
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
Conversation
…h the input from the AoC website
Hey there! Thanks for your interest in contributing this feature 💜 I was thinking about it recently actually as i've somewhat softened my previous stance. Originally I wanted to make it so that people still had to go to the advent of code website, but fetching the input doesn't change that since they'll need to do so to read the problem and get the cookie anyway. All that to say, I'm open to adding the feature. I want to be careful that this kind of thing doesn't lead to people spamming the advent of code website so we will want to ensure that if an input already has been downloaded we don't download it again for no reason. I'll be taking a look at this soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great so far! For this being your first time writing gleam i think you're doing a great job, keep at it!
Given these changes we should also be removing the FAQ question about input fetching being missing from the README and likely add a section on fetching input with the new flag.
…ad of the soon-to-be-deprecated os.getenv
All good remarks, thanks! |
… official AoC recommendations
…and return an error without trying to downloading it again if that's the case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! some minor things to follow up on
…nput file before fetching it, instead of calling both is_file and is_directory
Thanks a bunch! |
Some context
I know you had a couple reason to not have implemented this, but that's a feature that I'd really use. So, as I've developed something, I guessed I could try to open a PR, in case you'd be interested to merge it.
Bear with me that those are the first ever lines of code I've written in Gleam, so that's probably not very idiomatic. That's one of the reason why I'm eager to get feedback (if you are interested in the feature).
Description
The PR adds a new
--fetch
flag to thenew
command which will fetch the input directly from the AoC website (and put it at the correct place).It just needs to have the session cookie of the user in the
AOC_COOKIE
environment variable.