Skip to content

Instantly share code, notes, and snippets.

@tam17aki
Last active December 26, 2015 03:38
Show Gist options
  • Save tam17aki/7086913 to your computer and use it in GitHub Desktop.
Save tam17aki/7086913 to your computer and use it in GitHub Desktop.
Synthesize the number of unread tweets.
(eval-after-load "speech-synth"
'(progn
(defun speech-synth-new-tweets ()
(when (not (eq (length (twittering-current-timeline-data
twittering-new-tweets-spec))
twittering-new-tweets-count))
(let* ((buf-name (buffer-name (current-buffer)))
(num_new_tweets (+ (or (cadr (assq (get-buffer buf-name)
twittering-unread-status-info)) 0)
(length twittering-rendered-new-tweets))))
(when (>= num_new_tweets 1)
(cond ((string= ":home" buf-name)
(speech-synth-execute-synthesis
(format "新着ツイートが%d件来ましたよ." num_new_tweets))))))))
(add-hook 'twittering-new-tweets-rendered-hook
#'(lambda () (speech-synth-new-tweets)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment