Twitter desde la línea de comandos

Para los adictos a la línea de comandos disponemos de Twyt un cliente de Twitter escrito en Python. Ya podemos "tuitear" desde una consola SSH por ejemplo, o incluso hacer uso de este cliente desde alguna interfaz gráfica o usarlo desde tu cron o cualquier otro servicio del sistema. Y ya no tienes excusa para seguirnos.

La instalación es muy sencilla:

sudo aptitude install python-twyt

Para ver las opciones que esta aplicación nos ofrece, escribimos:

twyt --commands

Y obtenemos:

Usage: twyt  COMMAND [options] [args]

Available commands:
 accountlimit Show the API rate limit for your Twitter account.
        block Blocks a user specified by ID (numerical ID or screen name)
       delete Deletes a tweet by ID
       direct Sends a direct message to another user
    directdel Delete a direct message which was sent to you
   directsent Prints the 20 last direct messages sent by you
     directtl Prints the 20 last direct messages sent to you
    friendstl Returns 20 most recent statuses in your friends timeline
      iplimit Show the API rate limit for your IP address.
    namecache Access and manipulate the username cache.
     publictl Shows the 20 most recent statuses in Twitter's public timeline
      replies Lists statuses which are replies to you (statuses with @yourusername in them)
         show Show a single status message by ID
         sing Similar to 'tweet', wraps the status in musical notes
        tweet Updates the authenticating user's Twitter status
      unblock Unblocks a user specified by ID (numerical ID or screen name)
         user Get and set Twyt user options, e.g. remembered passwords and Twitter usernames
       usertl Show your timeline, or USERNAME's timeline

For command-specific help, use twyt COMMAND --help

Para ver las opciones de un comando en concreto:

twyt comando --help

Para ver los últimos 20 estados de la gente a la que sigues (nos pedirá nuestra contraseña):

twyt friendstl -u tu_cuenta

Para mandar un nuevo mensaje:

twyt tweet "tu nuevo mensaje" -u tu_cuenta

Para evitar que escribir la contraseña cada vez:

twyt user –user=tu_cuenta set

Está acción te preguntará el password y lo guardará en un fichero llamado .twytrc.json. Si miras el contenido del fichero verás que la clave se guarda en texto claro, así que cuidado.

Visto en Linux Magazine.