Howdy! Thanks for coming and enjoy your stay! Take a look at the sitemap and don't forget to chirp!

Twitter API: Picking the Right Source

July 17th, 2009

I’m sure you noticed that a few weeks ago Twitter changed the source that came unsigned via the API from web to API which could basically reveal any robot that is trying to act human, right? Well if you look at the statuses/update method in the Twitter API documentation they don’t say anything about the source parameter. Strange, right?

Working with the Twitter API: Tips & Tricks

Working with the Twitter API: Tips & Tricks

Well I read something about it on some forums and the Twitter API development talk Google Group had a discussion about this I believe, but most people still think that it’s the X-Twitter- headers that determine the source, but it’s not. It’s way too simple and it took me a few hours to figure it out using an HTTP sniffer on TweetDeck, Seesmic Desktop and the others.

Turns out it’s the source parameter that is passed via POST together with the status text during the statuses/update call. So usually you would do something like:

$postargs = array("status" => "I'm tweeting via API!");
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs);

Now, how about Seesmic Desktop?

$postargs = array(
    "status" => "I'm tweeting via Seesmic Desktop!",
    "source" => "seesmicdesktop"
);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs);

Or TweetDeck perhaps?

$postargs = array(
    "status" => "I'm tweeting via TweetDeck!",
    "source" => "tweetdeck"
);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs);

Pretty cool, huh? Here’s a brief list of sources to pick from:

And I do believe that it’s the same way for all the other clients. Lowercase and no spaces. It is funny though watching a robot tweet 10 tweets per minute via TwitterFon ;)

Related posts:

  1. Twitter API: Moving From Basic Auth to OAuth
  2. Brand Your Tweets with Twitter Anywhere
  3. The Importance of Using Twitter API via OAuth
  4. RIP Bit.ly? Twitter Will Launch Its Own Shortener
  5. TweetDeck & Seesmic Desktop on Fedora 10