Paul Huff ([info]phuff) wrote,
@ 2007-11-03 16:41:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
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.


(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?)



(Post a new comment)


[info]mhuff
2007-11-04 02:54 am UTC (link)
Huh. I mean that (without a question mark).

(Reply to this)(Thread)


[info]phuff
2007-11-04 07:30 pm UTC (link)
I love you.

(Reply to this)(Parent)


[info]hober
2007-11-04 04:24 pm UTC (link)
Could you post to [info]ljupdate about the filling problem? That's basically my bugtracker. :)

(Reply to this)(Thread)


[info]phuff
2007-11-04 07:30 pm UTC (link)
Yeah, I've been meaning to re-look at the fill stuff, I think I remember reading a post about it a year or two back, so I thought I'd be lazy and just put something in this post just on the off-hand that I was using it improperly.

(Reply to this)(Parent)


[info]ehuff
2007-11-04 04:32 pm UTC (link)
Um, what exactly is twittering? Can you explain it in dummied down language for the technologically illiterate?

(Reply to this)(Thread)


[info]phuff
2007-11-04 07:29 pm UTC (link)
Sure, go to twitter.com

Twittering is kind of like keeping a running log of what you're doing throughout the day. It's like a sort of blog, but not a blog. It's a way of keeping track of your peeps on line, if everybody twitters.

(Reply to this)(Parent)


[info]carenbobaren
2007-11-05 07:41 pm UTC (link)
Paul, I re-read this a few times and have to say that I have no idea what you are talking about. It's good to hear from you anyways.

(Reply to this)


Create an Account
Forgot your login?
Login w/ OpenID
English • Español • Deutsch • Русский…