Posts Tagged ‘url-encode’

Posting to Twitter… carefully

Thursday, November 13th, 2008

I’ve recently picked up my the code for my Windows Mobile Twitter client again.

It was originally written back in April as a hackday idea. The code posts Twitter updates using a variation on the twitter-from-curl approach of HTTP POSTing “status=MyTweet” to the twitter update url.

I started with the update URL, and appended the message I wanted to tweet. This is fine for a quick hackday demo, but it did mean that you could end up with a URL like:

http://twitter.com/statuses/update.xml?status=Hello (twitter) world! Special chars = a problem?

Which fails if you want to post characters such as accents or characters which have special meaning in URLs, like + ? / & etc.

I was encouraged by a number of users to have another look at this, which I’ve done now, and hopefully version 1.1 solves the problems.

A quick Google turned up that a number of other Twitter apps share at least some of the same problems that mine had, so thought I’d share the fix here.

(more…)