summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/man1/sup.122
-rw-r--r--bin/sup.sh23
2 files changed, 37 insertions, 8 deletions
diff --git a/bin/man1/sup.1 b/bin/man1/sup.1
index ba4fe3fd..4b266e06 100644
--- a/bin/man1/sup.1
+++ b/bin/man1/sup.1
@@ -23,6 +23,20 @@ or
 flow.
 The password is copied to the clipboard
 and the service login page is opened.
+For passwordless services
+with email-based authentication,
+the emailed login link is opened.
+.
+.Pp
+The following services are supported:
+.Cm asciinema ,
+.Cm discogs ,
+.Cm freebsdbugzilla ,
+.Cm liberapay ,
+.Cm lobsters ,
+.Cm tildenews .
+.
+.Pp
 The
 .Nm
 utility requires
@@ -32,11 +46,3 @@ utility requires
 .Xr pbcopy 1
 and
 .Xr open 1 .
-.
-.Pp
-The following services are supported:
-.Cm discogs ,
-.Cm freebsdbugzilla ,
-.Cm liberapay ,
-.Cm lobsters ,
-.Cm tildenews .
diff --git a/bin/sup.sh b/bin/sup.sh
index fb6ad4bf..b7f28bc7 100644
--- a/bin/sup.sh
+++ b/bin/sup.sh
@@ -11,6 +11,29 @@ copy() {
 	printf '%s' "$1" | pbcopy
 }
 
+asciinema() {
+	echo 'Fetching CSRF token...'
+	jar=$(mktemp -t sup)
+	trap 'rm "${jar}"' EXIT
+	csrf=$(
+		curl -Ss -c "${jar}" 'https://asciinema.org/login/new' |
+		sed -n 's/.*name="_csrf_token".*value="\([^"]*\)".*/\1/p'
+	)
+	echo 'Submitting form...'
+	curl -Ss -X POST -b "${jar}" \
+		-F "_csrf_token=${csrf}" -F "login[email]=${email}" \
+		'https://asciinema.org/login' \
+		>/dev/null
+	echo 'Waiting for email...'
+	url=$(
+		git fetch-email -i -M Trash \
+			-F 'hello@asciinema.org' -T "${email}" \
+			-S 'Login to asciinema.org' |
+		grep -m 1 '^https://asciinema\.org/session/new'
+	)
+	open "${url}"
+}
+
 bugzilla() {
 	echo 'Fetching CSRF token...'
 	csrf=$(
>June McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe God that makes the lexers so much simpler. 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe This simplifies some things, adds support for line number tag definitions, and should enable combining htagml with other preprocessors in the future. 2021-01-12Split fields by tab onlyJune McEnroe Also don't fail hard on non-forward-search definitions. 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I could type without getting frustrated. 2021-01-09Add c -t flag to print expression typeJune McEnroe Also add missing float case. 2021-01-05Update taglineJune McEnroe