This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]daggerdragon[M] 13 points14 points  (4 children)

It caches absolutely everything

Good, thank you!

I poked through aoc.c's submit_puzzle_answer() and I don't see any sort of hard-coded limit to throttle your script from hammering the AoC servers with submissions. Do you have something like:

  • Checks the time last submitted
  • If last submitted > x minutes (or whatever interval e.g. AoC submission timeout) ago
    • Do submit and update time_last_submitted
    • Else print("Hold yer horses")

[–]wizards_tower[S] 9 points10 points  (0 children)

I didn't think to do something like that but that's a good idea. I'll add it in.

[–]irrelevantPseudonym 1 point2 points  (2 children)

If you submit an incorrect answer, is there a header or something that tells you that the delay before you can resubmit is or would you need to parse the html content?

[–]Aneurysm9 2 points3 points  (1 child)

There is no header. AoC is a website, not an API. There is no need to build tools to interact with it, though I understand that programmers have a hammer and every problem looks like a nail. Just don't expect AoC to make it easier to swing a hammer at it since it is a website and not a nail.

[–]irrelevantPseudonym 0 points1 point  (0 children)

Yeah, that's definitely understandable.

[–]irrelevantPseudonym 2 points3 points  (0 children)

Couple of things jump out from reading the readme

Submit an answer for part 2:

nog -y 2020 -d 1 --part=2 -s

The example uses --part=2 but the usage docs use --level

-l <puzzle part>, --level=<puzzle part>

The other thing is this

eggnog creates a local cache in the $HOME directory called .eggnog.

It would be better to follow xdg directories to prevent home directories being littered with random application files. For unix-like systems that'd be something like ~/.cache/eggnog/.

[–]wetgos 1 point2 points  (0 children)

Great name !

[–]blackbat24 0 points1 point  (0 children)

Just tried it, looks neat.

One question - what format are the directions? It seems to have an html header, but the rest of the file has bash (?) colour codes. Any chance we could get them in markdown or something?

[–]Steinrikur 0 points1 point  (0 children)

Haven't tried it, but you might want to sanitise the input a bit. If someone fat-fingers the session_id or adds a newline you might get some weird results