Skip to content

Sign into this GitHub wiki

David-Apps edited this page Mar 22, 2024 · 8 revisions

You can edit this function so that it can sign you into this GitHub wiki. If the GitHub system sends you a device verification code, this function checks your IMAP mail account, reads the verification code, and enters the verification code in the form.

# Sign into the edbrowse wiki on GitHub.
# usage: <ghwiki
function+ghwiki {
db0
H-
sw+
js-
b https://github.com/CMB/edbrowse/wiki
/{Sign in}/g
if(*) {
# Replace me@example.com with the email address that you use for GitHub.
/Username/ i=me@example.com
# Replace my_password with your GitHub password.
# or, to enter your password each time, replace i=my_password with ipass
/Password/ i=my_password
i2*
/^Device Verification Code <>/X
if(*) {
etmp
# Check the first mail account in the configuration file.
imap 1
l=1
/INBOX/X
/s [GitHub] Please verify your device
while(?) {
sleep 5
/s [GitHub] Please verify your device
}
g
/^Verification code: /X
etmp
r+1@.
s/^Verification code: //
up
d
up2
i1<-3@.
i*
}
}
/^h1 /X
/^h1 Home/X
/^h1 /
}