commit d733b17cc2fbb9b7109d8bced04696748fa3a242
parent 2667cb9f1c74814e781af0a7dbf2a4693da555c4
Author: Eamon Caddigan <ec@eamoncaddigan.net>
Date: Tue, 9 Dec 2025 13:38:35 -0800
Add my email address as a User-Agent header for requests
I saw a request from the Advent of Code creator for people to make
themselves available for contact in the case of misbehaving scripts, so
I thought I'd comply. I _also_ saw that we're only supposed to make one
request every 15 minutes or so, and I haven't been great about. I'll do
better.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/utils.R b/src/utils.R
@@ -4,7 +4,10 @@ aoc_input <- function(day, year = 2025) {
}
con <- url(
sprintf("https://adventofcode.com/%d/day/%d/input", year, day),
- headers = c("Cookie" = paste0("session=", readLines("~/.aoc")))
+ headers = c(
+ "Cookie" = paste0("session=", readLines("~/.aoc")),
+ "User-Agent" = "ec@eamoncaddigan.net"
+ )
)
puzzle_input <- readLines(con)
close(con)