twittering-mode
- ref:twittering-mode
入れてみた。あー、生のパスワードを .emacs に直接書くのはちょっと、と思ったので、適当に改造。これで不用意に .emacs をさらしてパスワード漏れてアー、となる心配はしなくていい。
あと、複数ユーザの同時使用もできるようにとか、/tmp を temporary-file-directory に置換したりとか。いやでも、
--- twittering-mode.el.orig 2007-10-21 17:42:30.000000000 +0900 +++ twittering-mode.el 2007-10-21 18:04:41.000000000 +0900 @@ -99,7 +99,9 @@ (defun twittering-wget-buffer () (twittering-get-or-generate-buffer twittering-wget-buffer)) -(defvar twittering-tmp-dir "/tmp/twmode-images") +(defvar twittering-tmp-dir + (expand-file-name (concat "twmode-images-" (user-login-name)) + temporary-file-directory)) (defvar twittering-icon-mode nil "You MUST NOT CHANGE this variable directory. You should change through function'twittering-icon-mode'") (defun twittering-icon-mode (&optional arg) @@ -112,7 +114,7 @@ (when (or (null arg) (and arg (> (prefix-numeric-value arg) 0))) (when (file-writable-p twittering-tmp-dir) - (progn + (progn (if (not (file-directory-p twittering-tmp-dir)) (make-directory twittering-tmp-dir)) t))))) @@ -264,7 +266,7 @@ "Host: twitter.com" nl "Authorization: Basic " (base64-encode-string - (concat twittering-username ":" twittering-password)) + (concat twittering-username ":" (twittering-get-password))) nl "Accept: text/xml" ",application/xml" @@ -461,7 +463,7 @@ "Host: twitter.com" nl "Authorization: Basic " (base64-encode-string - (concat twittering-username ":" twittering-password)) + (concat twittering-username ":" (twittering-get-password))) nl "Content-Type: text/plain" nl "Content-Length: 0" nl @@ -803,5 +805,9 @@ (if username (twittering-update-status-from-minibuffer (concat "@" username " "))))) +(defun twittering-get-password () + (or twittering-password + (setq twittering-password (read-passwd "twittering-mode: ")))) + (provide 'twittering-mode) ;;; twittering.el ends here