Twitter API: Picking the Right Source

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?

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 ;)

TweetDeck & Seesmic Desktop on Fedora 10

Hey just got TweetDeck running on my Fedora 10 Laptop. It took me about 20 minutes to figure this out, I just had some permission issues (error 5100). Go get the latest Adobe Air from the official Adobe Air website and save it somewhere. Then you’ll have to chmod +x the .bin file to be able to execute it. Run it using your root account – that should install Adobe Air and some utilities for Air application management, just like Windows would (I guess).

Then, download the latest TweetDeck Air application for Linux. Now here’s where I got the permissions issues. You have to run the TweetDeck installation as root, otherwise you will not be able to write to the /opt directory – that’s standard for Air applications, though I wasn’t able to write to /home/myuser either, although I had full rights to access that, so I guess the right place is actually /opt. Open your terminal, logon to root and try the following:

/usr/bin/Adobe AIR Application Installer

That should launch the Adobe AIR app installer. Pick the TweetDeck .air file and attempt to install it. Worked for me. You can create the shortcut icons, but you shouldn’t launch TweetDeck after installation, cause you wouldn’t wanna run it as root, right? After the setup’s finished check out your Applications – Accessories menu, you should see TweetDeck.

Hope that helped. Used to TwitterFox but I guess TwitterDeck will do just great. Don’t forget to choose the right tweets update configuration (I got it working at about 80%). Don’t overload the API and don’t forget to switch off any other Twitter clients you use before launching TwitterDeck.

Updating TweetDeck or Seesmic Desktop on Fedora

I’ve stopped using TweetDeck for a while due to a couple of reasons. I got my Twitter developer account which gives me 20,000 API calls per hour (unlike the ordinary accounts with 100), and the new TweetDeck doesn’t work with that amount (I’ve no idea why), so I had to switch to Seesmic Desktop which is also based on Adobe AIR, thus cross-platform and I managed to install it on my Fedora 10 machine using the above method.

Updating TweetDeck and Seesmic Desktop (and all other Adobe AIR applications) is quite straightforward in Windows and Mac, but I came up with the same permissions issues in Linux. It seems that we’re not allowed to use the auto-update feature (the popup-box that shows up when you run TweetDeck and asks you to automatically update the software). So we’ll probably have to go the other way round. Go to TweetDeck or Seesmic Desktop official website and download the latest .AIR distro, save it somewhere, and as root run the AIR Application Installer program:

/usr/bin/Adobe AIR Application Installer

Select your .AIR file and update. After the update it automatically runs the new version of TweetDeck (or Seesmic Desktop). Close that. It’s being run under root, while your profile is on your regular user. Just start as a regular user and everything should be fine. Worked for me ;)

Good luck!

Updated June 20th 2009