Connecting a source

A URL your script can hit

For the work no API tracks. You get an unguessable URL, and anything that can make an HTTP request can report against it: a cron line, a CI step, a git hook, a Makefile target, a shortcut on your phone. No headers, no body, no client library.

New here? Toiling Away turns recorded time into animals that live in a habitat of your own.

Making one

In Toiling Away, open Connections -> addPing URL and give it a label:laptop cron, CI deploy, backup job. One URL per job, and the label is how you tell them apart afterwards. Reusing a label replaces that connection and its URL rather than making a second one.

The URL is shown once.Only a hash of it is stored, so it cannot be recovered or shown again, so put it straight where it is going. Lose it and you make a new one.

Three ways to report

One hit is one piece of work

The simplest thing that works, and worth five toil. To report several at once, add count: up to a hundred per request.

curl -fsS https://app.toilingaway.com/p/YOUR-TOKEN
curl -fsS "https://app.toilingaway.com/p/YOUR-TOKEN?count=3"

Or say how long it took

Seconds, if your script already knows. This is time rather than a count, so it earns ten toil an hour and merges with any other source covering the same stretch.

curl -fsS "https://app.toilingaway.com/p/YOUR-TOKEN?seconds=1800"

Or let it time itself

Hit /start at the beginning and the plain URL at the end, and the elapsed time is worked out for you, which is useful when the job's duration is the thing you actually want to record. The closing hit takes no parameters: any seconds orcount on it is ignored and the clock decides.

curl -fsS https://app.toilingaway.com/p/YOUR-TOKEN/start
./the-long-job
curl -fsS https://app.toilingaway.com/p/YOUR-TOKEN

If the job fails and you would rather not be credited for it, hit/fail instead, which abandons the run without recording anything. A run that is never closed is not credited either.

The same three verbs, pointed at a presence sensor, are howHome Assistantturns desk time into toil.

The limits, plainly

Twelve hours of time per URL per day, and a single stretch cannot exceed four hours: a run left open all weekend is credited as four hours, not as a weekend. Counting hits instead, it is up to a hundred per request and a thousand a day.

Past those, the URL answers with an error rather than silently doing nothing, so a script that cares can notice.

Ask for one thing at a time.seconds andcount cannot both be given in the same request; a piece of work is either an amount of time or a number of things.

Retries that cannot double up

Add rid (any string you like, as long as it is unique to that piece of work) and the same value is only ever counted once. That makes a retrying CI step, a flaky network or a script that runs twice by accident safe to leave alone.

curl -fsS "https://app.toilingaway.com/p/YOUR-TOKEN?seconds=600&rid=$GITHUB_RUN_ID"

Keep the URL to yourself

Anybody holding it can report work as you. It is the whole of the authentication, which is what makes it usable from a one-line cron entry. Treat it like a password: out of anything public, and into your CI provider's secret store rather than the workflow file. If it does get out, delete the connection and make another; the old URL stops working immediately.