Skip to content

Commit

Permalink
update readme and user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperVaessen committed Dec 5, 2024
1 parent 216550c commit 15a329f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
# AoCH
# AoCH Leaderboard

To start your Phoenix server:
This project shows the current statistics and leaderboard of CH members for the AoC.

* Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`
## Guidelines

This script follows the guidelines stated by [Advent of Code](https://www.reddit.com/r/adventofcode/wiki/faqs/automation), namely:

- it includes the emails of the maintainers and a link to the current repo in the User-Agent header for all outbound requests;
- it throttles the requests made to the website by only requesting (private) leaderboard updates every 15 minutes;
- the puzzle for each day is requested only once and 'cached' runtime only, so restarting the server removes the 'cache'.

## Start server

### With Mix

To start your dev Phoenix server:

* Run `mix setup` to install and setup dependencies
* Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server`

Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.

Ready to run in production? Please [check our deployment guides](https://hexdocs.pm/phoenix/deployment.html).
### With Docker

The project can also be run using the provided `Dockerfile` for this, simply build the docker image, `docker build -t aoch .` and run it: `docker run aoch`

## Questions and contributions

## Learn more
This project is created using the phoenix framework in elixir. I understand these are not the most well-known framework and language. So if you have any questions you can always contact Kasper at [[email protected]](mailto:[email protected]).

* Official website: https://www.phoenixframework.org/
* Guides: https://hexdocs.pm/phoenix/overview.html
* Docs: https://hexdocs.pm/phoenix
* Forum: https://elixirforum.com/c/phoenix-forum
* Source: https://github.com/phoenixframework/phoenix
If you have a feature request and don't know how to do it yourself, please create an issue and send an email to the above email address to let me know about it. I will try to maintain the leaderboard as long as possible.
4 changes: 2 additions & 2 deletions lib/aoch.ex
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ defmodule AoCH do
Req.get(url,
headers: [
{"cookie", "session=#{Application.get_env(:aoch, :aoc_session_cookie)}"},
{"User-Agent", "https://github.com/kaspervaessen/aoch, kasperv@ch.tudelft.nl"}
{"User-Agent", "https://github.com/WISVCH/AoCH, beheer@ch.tudelft.nl"}
]
)

Expand All @@ -220,7 +220,7 @@ defmodule AoCH do
Req.get(url,
headers: [
{"cookie", "session=#{Application.get_env(:aoch, :aoc_session_cookie)}"},
{"User-Agent", "https://github.com/kaspervaessen/aoch, kasperv@ch.tudelft.nl"}
{"User-Agent", "https://github.com/WISVCH/AoCH, beheer@ch.tudelft.nl"}
]
)

Expand Down

0 comments on commit 15a329f

Please sign in to comment.