Twitter + Quicksilver + Growl = Tweet+Growl
Wednesday, March 21st, 2007A while ago after much discussion of Twitter by Leo Laporte and Merlin Mann on MacBreak Weekly I decided to sign up. I like it, I can’t explain why, I just do. It satisfies my urge to talk to noone in particular.Shortly after discovering Twitter I immediately went looking for the best way to post to Twitter. Where I found the Tweet = Twitter + Quicksilver which is a great little script, but it never told me when it was successful. (and during twitters recent downtime I Tweet’d several times.)So in the spirit of open source I decided to improve it by adding Growl support. So without further ado I present to you Tweet+Growl
tell application "GrowlHelperApp" set the allNotificationsList to {"Success Notification", "Failure Notification"} set the enabledNotificationsList to {"Success Notification", "Failure Notification"} register as application ¬ "Tweet" all notifications allNotificationsList ¬ default notifications enabledNotificationsListend tellusing 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 & "-D - --data-binary " & twitter_status & " http://twitter.com/statuses/update.json" set code to word 3 of results if code = "200" then tell application "GrowlHelperApp" notify with name ¬ "Success Notification" title ¬ "Tweet Success" description ¬ "Successfully twittered \"" & tweet & ¬ "\"" application name "Tweet" end tell else tell application "GrowlHelperApp" notify with name ¬ "Failure Notification" title ¬ "Tweet Failure:" & code description ¬ "Failed to twitter \"" & tweet & ¬ "\"" application name "Tweet" end tell end if return nothing end process textend using terms from