Created
December 1, 2009 00:26
-
-
Save shayne/245925 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- get properties of the playing track | |
tell application "PandoraBoy" | |
set trackArtist to artist of current track | |
set trackName to name of current track | |
end tell | |
-- change the status message to your liking here: | |
set tweet to "♫ " & trackArtist & " - " & trackName | |
-- let the user edit | |
display dialog "Edit your Twitter status" with title "TwiTunes" default answer tweet cancel button 1 default button 2 buttons {"Cancel", "Send"} | |
set tweet to (text returned of result) | |
-- get login from keychain | |
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 | |
-- post to twitter | |
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 "Twitter Status was updated. | |
" & tweet with title "TwiTunes" default button 1 buttons "OK" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment