Posting to Twitter

Here’s a cool script for posting the web page you’re currently viewing to Twitter. Question: sometimes it shortens the URL via bit.ly, sometimes it doesn’t (I’m guessing it depends on the site). Is there a way to write this capability into the script? ```
tell application “DEVONthink Pro”
set theUrl to URL of front window
set theSource to source of front window
set theTitle to get title of theSource

set the user_name to "yourTwitterusername"
set the user_password to "yourTwitterpassword"

display dialog "Text of note:" default answer "" buttons {"Cancel", "OK"} default button 2
set theNote to the text returned of the result


-- LOGIN IN TO TWITTER AND POST UPDATE
do shell script "curl -u " & user_name & ":" & user_password & " -d status=\"" & theNote & " " & theTitle & " " & theUrl & "\" http://twitter.com/statuses/update.xml"

end tell

The URL is probably shortened if the length of note+title+URL exceeds 140 characters.