Created
October 5, 2016 12:48
-
-
Save gongo/89a05b152fc75fceb14aa38890e0d3c8 to your computer and use it in GitHub Desktop.
Emacs を終了したら LINE に通知が行くやつ
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
(require 'request) | |
(defconst line-notify--endpoint | |
"https://notify-api.line.me/api/notify") | |
(setq line-notify-token "XXXXXXXXXX") | |
(defun line-notify-sync (message) | |
(request | |
line-notify--endpoint | |
:type "POST" | |
:sync t | |
:data `(("message" . ,message)) | |
:headers `(("Authorization" . ,(concat "Bearer " line-notify-token))))) | |
(add-hook 'kill-emacs-hook | |
(lambda nil | |
(line-notify-sync (concat "died at " | |
(format-time-string "%Y/%m/%d %r"))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://gongo.hatenablog.com/entry/2016/10/05/214855