Since Facebook puzzlingly doesn’t provide an API for this, you have to go through some hoops. My solution is based on the trick described over at nexdot.net and basically amounts to logging in to Facebook’s mobile site (which, unlike the regular one, allows updating the status through HTTP POST, rather than only through AJAX trickery), storing the cookie, then reading it and posting the status message.
The Twitter, Quicksilver and Adium aspects are based on this little script as well as this one. Finally, the Skype part is easy to add once you understand their API a little.
The resulting script looks like this:
using terms from application "Quicksilver"
on process text NewStatus
tell application "Adium"
set my status message to NewStatus
end tell
tell application "Skype"
send command "SET PROFILE MOOD_TEXT " & NewStatus script name "Quicksilver StatusUpdater"
end tell
tell application "Keychain Scripting"
set twitter_key to first Internet key of current keychain whose server is "twitter.com"
set twitter_login to quoted form of (account of twitter_key & ":" & password of twitter_key)
end tell
set twitter_status to quoted form of ("status=" & NewStatus)
do shell script "curl --user " & twitter_login & " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json"
tell application "Keychain Scripting"
set facebook_key to first Internet key of current keychain whose server is "login.facebook.com"
set facebook_username to account of facebook_key
set facebook_password to password of facebook_key
end tell
do shell script "curl -v -k -d email='" & facebook_username & "' -d pass='" & facebook_password & "' -d login=Login -L 'https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php' -A 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3' --cookie-jar /tmp/facebook-cookie.txt"
do shell script "curl -v -d post_form_id=006f908f4d524763335c4613e2dadd42 -d status='" & NewStatus & "' -d update='Update' -A 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3' --cookie /tmp/facebook-cookie.txt 'http://m.facebook.com/home.php' -L"
end process text
end using terms from
For both Twitter and Facebook, I use Keychain to get the username and password, which means that there’ll be a bit of a delay the first time you use this (and you’ll have a few dialog boxes to confirm), but which also means the password isn’t lying around hardcoded and unencrypted (but it is transmitted in unencrypted form to twitter!).
To use this, open Script Editor, save it as, say, StatusUpdater.scpt in ~/Library/Application Support/Quicksilver/Actions (you may have to create that folder; it did not exist in my case) and relaunch Quicksilver. Then, hit your Quicksilver trigger (such as ctrl-space), type . (a period), enter your status, hit tab and choose the script (typically by typing something like s-t). As you hit enter, all four should update your statuses, and everyone will know what you’ve just eaten. Isn’t Internet life wonderful?
Others' Thoughts
Comment on July 26th, 2007 at 2:54 am
Hey I’m trying to use the script, I think it’d be really cool to do all of them at once, but just a couple of questions.
I don’t use skype, can I just remove the section about skype and it’ll still work?
I can’t put it in Script Editor. For some reason whenever I try to save it, it tries to run it, then tells me that it can’t save it. Using a text editor works, but Quicksilver doesn’t see it as a script, so I guess it doesn’t work…How can I fix this?
Comment on July 26th, 2007 at 8:46 am
Comment on August 6th, 2007 at 2:50 am
Hi, I’ve been looking for something like this, thanks for the effort you’ve put into it.
It works fine updating my Adium and Twitter status but doesn’t seem to be having any effect on Facebook (I downloaded the non-Skype script from your comment above).
Is there typically a delay? Or am I supposed to edit the script with my usernames and passwords?
I do have Keychain Access enabled for Facebook.
Thanks!
Comment on August 6th, 2007 at 2:54 pm
Hi Christopher, there was a bug (or, rather, a lazy omission) in my code. There shouldn’t be a delay (much more than a few seconds, anyway), nor should you have to hardcode your username and password into it (it fetches those from Keychain).
Check here for a newer script that hopefully fixes your issue.
Comment on October 10th, 2007 at 4:49 pm
Thanks! This looks useful!
Your Own Thoughts
I'd love to hear your input. Just try to stick to a few rules:
Before you comment for the first time (or, after you have deleted cookies), you will have to answer a little challenge to prove that you are not a spammer.
Comments are written in Markdown.