twyt — API для Python и консольное приложение для постинга в Twitter. Учитывая, что в Twitter размер сообщений не превышает заветные 140 знаков, пользоваться коносльной утилитой достаточно комфортно. Для установки в Ubuntu потребуются пакеты python, python-simplejson.
$ sudo apt-get install python python-simplejson
В репозитарии Ubuntu кстати есть пакет python-twyt, но версия клиента в нем запаздывает. Поэтому установим самостоятельно.
Получаем пакет с сайта проекта
http://andrewprice.me.uk/projects/twyt/
$ wget -c http://andrewprice.me.uk/projects/twyt/download/twyt-0.9.2.tar.gz
Распаковываем архив и устанавливаем как обычное Python приложение:
$ tar xzvf twyt-0.9.2.tar.gz
$ cd twyt-0.9.2
$ sudo ./setup.py install
Не смотря на небольшие размеры параметров утилита имеет предостаточно:
$ twyt --commands
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
Параметр set позволяет сохранить логин и пароль к аккаунту Twitter, что очень удобно так как не нужно будет их указывать каждый раз (при помощи -u).
$ twyt user -u tux_in set
Enter tux_in's Twitter password:
Теперь данные будут сохранены в скрытом файле ~/.twytrc.json в домашнем каталоге. Заглянув внутрь можно проверить пароль. Если аккаунтов на Twitter несколько, то установленный первым будет помечен как default.
$ cat ./.twytrc.json
{
«default»: «tux_in»,
«stamps»: {},
«accounts»: {
«tux_in»: {
«pass»: «************»
},
«names»: []
Теперь постим:
$ twyt tweet "Привет всем"
[9694464211] tux_in: Привет всем (Fri Feb 26 20:14:16 2010 via Twyt)
Получим 20 популярных записей друзей:
$ twyt friendstl
И так далее. Очень простая утилита, для тех кто пользуется Twitter.
//
э.. а gwibber круче.. и проще! )