Created
October 18, 2021 19:45
-
-
Save iocanel/acb240650095baac571ffc371f9bde83 to your computer and use it in GitHub Desktop.
Get the current user from the github buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun github-current-user () | |
"Get the curently logged in user." | |
(let ((page-source (if (web-buffer-p (current-buffer)) | |
(plump:serialize (document-model (current-buffer)) nil) | |
(ffi-buffer-get-document (current-buffer))))) | |
(ppcre:register-groups-bind (user) (".*<meta name=\"user-login\" content=\"([a-zA-Z0-9_-]+)\">.*" page-source) user))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment