Tweet = Twitter + Quicksilver

I’m not entirely sure why, but I signed up again for Twitter this morning. Now that it’s not just Tony sending me text messages at 2am about chocolate cake, I can see why people like it. I’ve also been spending some serious time getting geeky with Quicksilver, so I decided to hack together a script to make the two play nicely together.
The upshot? Cmd+Space, period, type your message, tab, tw, enter.
First, The Script
using terms from application "Quicksilver"
on process text tweet
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=" & tweet)
set results to do shell script "curl --user " & twitter_login & " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json"
-- display dialog results
return nothing
end process text
end using terms from
Copy this to the clipboard.
Second, Installing It
Paste the script into Script Editor and save it in ~/Library/Application Support/Quicksilver/Actions as Tweet.scpt.
Restart Quicksilver (Cmd+Ctrl+Q).
Third, Configuring It
If you’re not already using Twitterrific, open Keychain Access and add a new password with the following data:
- Keychain Item Name: http://twitter.com
- Account Name: Your email address
- Password: Your Twitter password
If you’re already using Twitterrific, this password will already be in your Keychain. So just sit tight.
Fourth, Using It
Open up Quicksilver (either Ctrl+Space or Cmd+Space), and hit period. Type out your message, and hit tab when you’re done. Type out as much of the word “Tweet” as you need to select the Tweet action. Hit enter. There, it’s sent.
There is no error checking, so if you’ve got the wrong login info, or if Twitter is down, you’ll never know about it. I guess I’m an optimist. Also, it’s Twitter!
Enjoy!
Update: 1/16/07 Added escaping for the status so that special POSIX characters in your tweet don’t freak out the Bash shell.
Update: 1/20/07 Switched over to --data-binary from -F so that messages which started with @ can be posted.
Update: 1/21/07 Just realized that Quicksilver picks up the script as an action if you put it in the Actions folder, making everything way easier and way less complicated. Yay!
98 comments »