Skip to content

Instantly share code, notes, and snippets.

@ympbyc
Created November 24, 2011 13:18
Show Gist options
  • Save ympbyc/1391329 to your computer and use it in GitHub Desktop.
Save ympbyc/1391329 to your computer and use it in GitHub Desktop.
Tweet the first line of the *terminal* buffer on double-clicks. (for nethack)
(set-buffer "*terminal*")
(defun get-message-and-tweet ()
(goto-char (point-min))
(let ((point (point)))
(goto-char (line-end-position))
(tweet (buffer-substring point (point)))))
;;post to twitter. modify this function to use any other programs than tw4sh
(defun tweet (text)
(if (> (length text) 0)
(call-process "tw4sh" nil "*Messages*" nil "-a" "post" text)))
;;affects all buffers. who cares??
(local-set-key [double-mouse-1] 'trigger)
(defun trigger (click)
(interactive "e")
(get-message-and-tweet))
M-x term
nethack
M-x load-file
/path/to/nethackinTwitterer.el
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment