I've just implemented a feature on my site to use the Twitterizer API in C# to make a tweet under a machine account whenever new user content is added to my site.
Works great, but if I call the Twitterizer Update() method directly and the tweet includes a URL, the URL is not getting run through Twitter's new URL shortening Link Serverice http://t.co
Here's the stub I'm currently using:
public static void PostTweet(string text, string url)
{
OAuthTokens tokens = (OAuthTokens)HttpContext.Current.Application[AppCache.TwitterOAuthTokens];
TwitterResponse<Twitterizer.TwitterStatus> tweetResponse = Twitterizer.TwitterStatus.Update(tokens, String.Format("New Prediktion: \"{0}\" {1}", text, url));
}
Is there a Twitter API I can call to shorten up the URL? I was hoping this would happen automagically when I invoked Update(), but no such luck. If not, what are my alternatives? I want both shorter URLs and clickable URLs in the tweet.
EDIT:
I guess the real question is: If I'm patient, will I eventually start getting shortened and clickable URL's in my tweets for free as the new...
...service is rolled out?
Right now, if send the following text to the Twitter API, I just get a tweet with raw text, but no clickable URL:
string tweet = "Hey, check out this cool new site! http://real-cool-site.com";
Twitter's url shortener is applied automatically, but (according to their support page) is still being rolled out and may not be applied to every link.
You do not need to do anything to apply the shortened url and can expect the shortened url to be 19 characters long.