by Chris
Saturday, July 25 2009
I recently came across a great Twitter extension for BlogEngine.net that allows for quick tweeting of a post. The name of the extension is ReTweet, and the original author, Krishnan, has posted the code and an installation walk-thru on his blog, located here. The extension even includes functionality for automatic shortening of the URL through bit.ly. VERY nice.
It works very well, with one exception. It fails to URL encode the title of the post, so if you use an ampersand (&), for example, it truncates the rest of the tweet.
If you are going to use it, I suggest making the following change to the code source file (retweet.cs):
Line 108: string retweet = "http://twitter.com/home/?status=RT+@" + twitterUser + " " + System.Web.HttpUtility.UrlEncode(title) + "+-+";
I must note that, while we do use ReTweet on our blog, we have stripped-out the other features (delicious and DotNetKicks) so that it only displays the Twitter function.
If you have any questions regarding this post, feel free leave a comment and I will get back to you.
In order to actually see the ReTweet option, you must view an individual post. For an example, click here.
UPDATE - 7/26/09: Recently made an update to allow for tracking bit.ly short URLs with Google Analytics. See it here.