As always, I wrote it in PHP with the pecl/Oauth extension, available in the fedora repository (and in remi for old versions or Enterprise linux).

You can download it from

A very useful example: Using pecl/oauth to post to Twitter


$ su -c "yum install php-pecl-oauth"
$ wget -O ~/bin/twit
$ chmod +x ~/bin/twit


To start, you must register a consumer application on This operation will allow you to get a couple of Consumer key and Consumer secret.

Then, you need to register this codes in the application configuration:

$ twit register xxxxxxx yyyyyyyyyyyyyyyyyyy

twit version 0.1

Please visit
Then run again with 'access' option

Browsing to the displayed URL will allow the application to use your account.

Check the access:

$ twit access

twit version 0.1

Access granted !

This must be done only once, then the credentials will be recorded in the configuration file  ~/.config/phptwit/account.


Without option, the command display the current status :

$ twit

twit version 0.1

Name: Remi Collet
Last: twit version 0.1 released, see
Date: Sun Jun 26 08:54:02 +0000 2011

With a message, it updates the status :

$ twit 'From blog :'

twit version 0.1

Tweet sent for RemiCollet !


Quite simple ?

It you want to follow me, my twitter.