From 864144ab38295a1baee5832fac037e20e7e13c66 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 21 Feb 2021 22:08:37 -0500 Subject: Add asciinema to sup --- bin/man1/sup.1 | 22 ++++++++++++++-------- bin/sup.sh | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) (limited to 'bin') 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=$( -- cgit 1.4.1 >
path: root/unscoop.1 (unfollow)
Commit message (Expand)Author
2019-12-31Add option to group events by contextJune McEnroe
2019-12-31Add missing includeJune McEnroe
2019-12-31Use standout mode for highlightingJune McEnroe
2019-12-31Rewrite scoop(1) argument descriptionsJune McEnroe
2019-12-31Color both nicks in a changeJune McEnroe
2019-12-31Implement nick-colored outputJune McEnroe
2019-12-31Only enable highlighting on terminal outputJune McEnroe
2019-12-31Set up pager pipeJune McEnroe
2019-12-30Normalize date inputJune McEnroe
2019-12-30Add initial rough version of scoopJune McEnroe
2019-12-30Join with USING wherever possibleJune McEnroe
2019-12-30Add -D flag to prospective scoop manualJune McEnroe
2019-12-30Order results by ID in outer query in litterboxJune McEnroe
2019-12-30Use X macro for Type enumJune McEnroe
2019-12-30Remove scoop -ABCJune McEnroe
2019-12-30Add limit option for litterbox's search query interfaceJune McEnroe