| Paul Huff ( @ 2007-11-03 16:41:00 |
Facebook and twitter update at the same time.
I finally went ahead and installed twit.el this weekend. I did it because I figure I ought to be twittering my status updates. So, I wrote the following wrapper script around my facebook.el and
twit.el so I can update them both at the same time.
I'd love to write some crappy NLP in elisp to see if I can get it to parse out a "Paul is..." from a twitter update some time, but I doubt that will ever happen. But it would be fun. So, I just upper-case the first letter of the facebook status since that should make a decent twitter post anyway.
I'm a beginning twitterer, but I was surprised that simply https-ifying the url didn't quite work, which was sad, because it's sending my password over the net plaintext. Oh well, that's what a throwaway password's for anyway, right? I was able to make it so I don't have to put in my username and password to twit.el everytime by doing this:
Man, those cats who wrote the url package in emacs sure did their homework :)
(p.s. extra spacing in the elisp because I can't figure out how to get around lj-update's fill stuff at the end. Anybody know how to fix that?)
I finally went ahead and installed twit.el this weekend. I did it because I figure I ought to be twittering my status updates. So, I wrote the following wrapper script around my facebook.el and
twit.el so I can update them both at the same time.
(defun set-status (status-message)
(interactive "sStatus message: ")
(let* ((split-message (split-string status-message))
(whole-message (mapconcat 'identity (cons
(capitalize (car split-message))
(cdr split-message)) " ")))
(facebook-users-set-status status-message)
(twit-post-function twit-update-url whole-message)
))
I'd love to write some crappy NLP in elisp to see if I can get it to parse out a "Paul is..." from a twitter update some time, but I doubt that will ever happen. But it would be fun. So, I just upper-case the first letter of the facebook status since that should make a decent twitter post anyway.
I'm a beginning twitterer, but I was surprised that simply https-ifying the url didn't quite work, which was sad, because it's sending my password over the net plaintext. Oh well, that's what a throwaway password's for anyway, right? I was able to make it so I don't have to put in my username and password to twit.el everytime by doing this:
(require 'twit) (setq twit-base-url "http://username:password@twitter.com") (setq twit-update-url (concat twit-base-url "/statuses/update.xml"))
Man, those cats who wrote the url package in emacs sure did their homework :)
(p.s. extra spacing in the elisp because I can't figure out how to get around lj-update's fill stuff at the end. Anybody know how to fix that?)