Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Updated sync script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Updated sync script
Authored by: nlb666 on Oct 25, '08 04:50:54AM
Sorry all I just noticed my sync script appears to start Adium/Skype rather than simply check when they're running. This one, on Tiger at least, seems to avoid that side effect. Replace ~/Library/Scripts/sync-status-with-twitter.sh with the following:

#/bin/sh
userid=$1
password=$2
message=`curl -s -u $userid:$password "http://twitter.com/statuses/user_timeline/$userid.atom?count=1" | grep '<entry>' -A 5 | grep "<title>" | perl -pi -e "s/<title>|<\/title>|$userid:| //g" | perl -pi -e 's/"/\\"/g'`

bool=`osascript -e "tell application \"System Events\" to set isRunning to count processes whose name is \"Adium\""`
if [ "$bool" -gt 0 ]; then
osascript -e "tell application \"Adium\" to set the status message of every account whose status type is available to \"$message\""
fi

bool=`osascript -e "tell application \"System Events\" to set isRunning to count processes whose name is \"Skype\""`
if [ "$bool" -gt 0 ]; then
osascript -e "tell application \"Skype\" to send command \"SET PROFILE MOOD_TEXT\" & \"$message\" script name \"updater\""
fi
Now you'll need to reload the plist file and all should be well

launchctl unload ~/Library/LaunchAgents/com.liketribe.twitterstatus.plist
launchctl load ~/Library/LaunchAgents/com.liketribe.twitterstatus.plist


[ Reply to This | # ]