8000 Add the possibility to fetch the input directly from the AoC website by renaudlenne · Pull Request #16 · TanklesXL/gladvent · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 11 commits into from
Dec 6, 2024

Conversation

renaudlenne
Copy link
Contributor
@renaudlenne renaudlenne commented Nov 27, 2024

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 the new 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.

@TanklesXL
Copy link
Owner

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!

8000

Copy link
Owner
@TanklesXL TanklesXL left a 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.

@renaudlenne
Copy link
Contributor Author

All good remarks, thanks!
I've pushed two new commits that should address them.

src/gladvent/internal/cmd/new.gleam Outdated Show resolved Hide resolved
Copy link
Owner
@TanklesXL TanklesXL left a 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

@TanklesXL TanklesXL self-requested a review December 6, 2024 15:42
@TanklesXL
Copy link
Owner

Thanks a bunch!

@TanklesXL TanklesXL merged commit 6f2b022 into TanklesXL:main Dec 6, 2024
5 checks passed
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.

2 participants
0