Packages

Commemorate people with the x-clacks-overhead HTTP header

Current section

Files

Jump to
Raw

README.md

# clacks_overhead
A man is not dead while his name is still spoken.
[![Package Version](https://img.shields.io/hexpm/v/clacks_overhead)](https://hex.pm/packages/clacks_overhead)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://clacks-overhead.hexdocs.pm/)
> X-Clacks-Overhead is a non-standardised HTTP header based upon the fictional
> work of the late, great, [Sir Terry Pratchett](https://en.wikipedia.org/wiki/Terry_Pratchett).
>
> In Terry Pratchett's science-fantasy
> [Discworld](https://en.wikipedia.org/wiki/Discworld) series, "The Clacks" is a
> network infrastructure of Semaphore Towers, that operate in a similar fashion
> to telegraph - named "Clacks" because of the clicking sound the system makes as
> signals send.
>
> In Sir Terry's novel "Going Postal", the story explains that the inventor of
> the Clacks - a man named Robert Dearheart, lost his only son in a suspicious
> workplace accident, and in order to keep the memory of his son alive, he
> transmitted his son's name as a special operational signal through the Clacks
> to forever preserve his memory:
>
> GNU John Dearheart
>
> G: Send the message onto the next Clacks Tower.
>
> N: Do not log the message.
>
> U: At the end of the line, return the message.
>
> The nature of the 'GNU' code would keep the name of his son forever
> transmitting through The Clacks network so long as the network still existed.
_Credit: <https://xclacksoverhead.org/home/about> 2026_
```sh
gleam add clacks_overhead@1
```
```gleam
import clacks_overhead
import gleam/http/request.{type Request}
import gleam/http/response.{type Response}
import my_app
pub fn page_one(request: Request(String)) -> Response(String) {
// Commemorate Terry with the header `x-clacks-overhead: GNU Terry Pratchett`
my_app.make_page_one_response(request)
|> clacks_overhead.commemorate_terry
}
pub fn page_two(request: Request(String)) -> Response(String) {
// Or commemorate someone else with the `x-clacks-overhead` header
my_app.make_page_two_response(request)
|> clacks_overhead.commemorate(["Chris Young"])
}
```
Further documentation can be found at <https://clacks-overhead.hexdocs.pm/>.