Witty

Jan 14 2008

I heard of Witty through this article on Arstechnica. Having used Google Talk until now to do my twittering, I decided to try it out.

Witty 0.1.6 Alpha

I didn’t work. I could log in, but it wouldn’t display updates. Trying to post something always resulted in Witty crashing.

So I decided to get the source from the subversion repository, to see what’s wrong. That’s the power of open source for you, baby. ;)

It turned out that Witty had a problem with parsing the dates returned from Twitter. These are in a fixed format, so the code wanted to parse them like this:

tweet.DateCreated = DateTime.ParseExact(
  dateString,
  twitterCreatedAtDateFormat,
  CultureInfo.CultureInfo, DateTimeStyles.AllowWhiteSpaces);

While that might work fine for users with english system settings, it gives a problem for all those who have different regional settings. So I fixed (those  3 occurrences) by forcing the date parsing to follow english regional settings:

tweet.DateCreated = DateTime.ParseExact(
  dateString,
  twitterCreatedAtDateFormat,
  CultureInfo.GetCultureInfoByIetfLanguageTag("en-us"), DateTimeStyles.AllowWhiteSpaces);

Witty works fine now, for all regional settings.

iTunes » MagnusAssault on Magnus


No responses yet

Leave a Reply