Page 1 of 1: First Prev Next Last

Web Log - Twyt

Twyt Discontinued

By Andrew Price, 2011-03-25 16:38:42 in Twyt. (Permalink)

This is kind of an overdue announcement but I am discontinuing my development of Twyt. It has not worked properly since Twitter switched off basic auth in favour of OAuth and I have no interest in making it work again. The bzr repository is still available so if anybody does have any interest in making it work, feel free. Perhaps it could be turned into a StatusNet client.

Twyt 0.9.1 - Under The Same Stars

By Andrew Price, 2009-02-17 22:01:50 in Twyt. (Permalink)

Twyt Logo

Twyt 0.9.1 has been released and is available to download from the usual place.

This release cycle has been pushed along by suggestions, patches and testing from users of the twyt command line client, so the twyt Twitter API module has only undergone some tweaks and just a few additions to the set of supported API methods.

Changes to the twyt client include:

The #twyt hashtag is getting used quite regularly now, but for bug reports and patches please stick to good, old-fashioned email.

Twyt 0.9.0 - Flowers On The Ceiling

By Andrew Price, 2009-01-04 09:20:12 in Twyt. (Permalink)

Twyt Logo

Twyt 0.9.0 has been released and is available to download from the usual place. The python-twyt packages in Debian and Fedora will be updated shortly.

This release incorporates lots of little fixes, and updates which were required to keep up with changes to the Twitter API. Scripts which import previous versions of twyt may need updating.

The accompanying command line client, twyt, has also been improved. In particular it has better support for multiple Twitter accounts and allows you to flag one username as the default. It also now uses simplejson to store user configuration so the .ini-style config files generated with older versions of twyt will be ignored (apologies for the inconvenience, to the three people who use it).

Note that the number of Twitter API methods which twyt supports has not increased - I'll get around to adding support for more of them next time I'm in the mood. Meanwhile, if you're a Python coder and you've got nothing better to do, feel free to read the APITODO file to see what's missing and email me a patch, or the URL of your bzr branch. It's easy-peasy stuff.

Twyt 0.8.5 - Dancing Like Astley

By Andrew Price, 2008-05-18 00:44:09 in Twyt. (Permalink)

Twyt 0.8.5 has been unleashed. Twyt is a python Twitter API library and accompanying command line Twitter client.

This version improves greatly on the previous command line interface with added --help for each subcommand. The client code has been rejigged to use Python's optparse making it more scalable and flexible than before. It also has better local timezone and DST support. Here's a quick example:

andy@plato:~$ twyt --commands
Usage: twyt COMMAND [options] [args]

Available commands:
    archive Shows 80 of your status messages ordered by date of posting
     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 (or USERNAME's) friends timeline
   publictl Shows the 20 most recent statuses in Twitter's public timeline
    replies Show the Nth page of 20 replies (messages with @yourusername in them)
   savepass Saves your username and password for subsequent use
       show Show a single status message by ID
      tweet Updates the authenticating user's Twitter status
     usertl Show your timeline, or USERNAME's timeline

For command-specific help, use twyt COMMAND --help
andy@plato:~$ twyt tweet "Showing off Twyt's cool, new, helpful, optparsed interface"
[813846209] twytdev: Showing off Twyt's cool, new, helpful, optparsed interface (Sun May 18 00:13:00 2008 via <a href="http://andrewprice.me.uk/projects/twyt">Twyt</a>)

Next on the TODO list for Twyt are better support for multiple Twitter accounts and more complete support for the rest of the API functions. A handful of new API functions has appeared over the last few months so it'll be a challenge to catch up. My aim is to release version 1.0.0 once the whole API is supported in Twyt.

Updated python-twyt packages will hit Debian unstable very soon and Fedora as soon as I've finished upgrading to Fedora 9 (modulo studying for my final exams which start on Monday).

Tracking Commits With Twitter And Twyt

By Andrew Price, 2008-04-04 12:46:22 in Twyt. (Permalink)

Twyt Logo

The python-twyt package provides a Twitter client API library ('from twyt import twitter') and a command line client ('twyt') which uses the library. One way to use it is to integrate twyt into a shell script to automate your Twitter updates. Here's an example.

Sally the software maintainer wants to let her development team keep track of repository commits while they're away from their computers. She installs python-twyt, sets up a Twitter account for her project and tells twyt the username and password for that account. She then writes a shell script which parses from the email details such as the short commit log and the link to the commit diff in the repository's web interface and calls:

twyt tweet "$devname $shortlog $link"

Sally also sets up a procmail rule to pipe emails from her project's commits list into her script.

So when an email arrives from the commits list procmail triggers the script, sending the summary to Twitter. It then gets distributed to Sally's followers, whether they're using email, SMS or any of the other supported notification methods. The developers (who are clearly very dedicated) smile at being able to keep track of the project on their mobile devices while they're out grocery shopping or in the bath.

I'm not sure if this would be a highly desirable real-world application of twyt but it's one possibility. If anyone implements it, do let me know. It's worth noting, however, that Twitter does have usage limits and won't accept over a certain amount of updates per hour or send over a certain number of SMS messages to each user per week.

[Update: Dave Murphy has just reminded me that you can bypass the whole mailing list stage by using the commit hooks for your code repository to trigger the script]

Twyt 0.8 - Coming At You Like A Buzzard

By Andrew Price, 2008-01-27 14:01:40 in Twyt. (Permalink)

I've just released Twyt 0.8. It includes added support for Twitter user functions, better HTTP error handling, improved documentation and status messages posted with the twyt command line client now show up as 'from Twyt' instead of 'from web'. The Fedora and Debian python-twyt packages will be updated shortly.

[ P.S. This will be the first of my blog entries to pop up on Planet Fedora, so hello to all you Fedorable people! ]

Twyt (Reprise)

By Andrew Price, 2008-01-06 17:21:10 in Twyt. (Permalink)

Since the majority of twyt's code is reusable I've decided to brand it as an alternative Twitter API Python module instead of just a command line client. It's pretty simple to use, as exemplified by the following exciting and contrived Python session:

>>> from twyt import twitter, data
>>> t = twitter.Twitter()
>>> t.set_auth("username", "password")
>>> return_val = t.status_update("Test")
>>> s = data.Status()
>>> s.load_json(return_val)
>>> print s
[568644162] Andy Price: Test (Sun Jan 06 16:10:53 +0000 2008 via web)
>>> print s.id
568644162
>>> t.status_destroy(s.id)

A quick run through the code: set_auth() tells the Twitter object your username and password. Then status_update() sends your status message to Twitter and return_val is set to the JSON formatted string that Twitter sends back. We then load the JSON string into a Status object which lets us access the returned data (the details of the new status message) conveniently. We then pass the id of the new status message into status_destroy() which tells Twitter to delete the status message, because it's boring.

The docs in the classes are pretty good so help() should be your friend. Go forth and write super-shiny twyt-based applications.

Twyt is now in Fedora Rawhide and Debian Unstable, so it should propagate into Ubuntu Hardy Heron (universe) soon. Those of you brave enough to run Rawhide, Unstable and Hardy can install twyt using 'yum install python-twyt' or 'apt-get install python-twyt' respectively. Alternatively, just grab the latest tarball.

Twyt - A Command Line Twitter Client

By Andrew Price, 2007-12-27 05:53:53 in Twyt. (Permalink)

Allow me to introduce my new little python program named Twyt (randomly chosen but could be backronymed to "That's what you think").

Twyt allows you to post twitter messages, delete them, view your friends' latest messages and view other various twitter "timelines" from the command line. It's very young and really only does enough stuff to keep me happy so it might be lacking in features that others may desire. Patches welcome, as usual.

I wrote twyt a couple of weeks ago after I couldn't find a twitter client that met my standards and stumbled across the Twitter API docs. If you prefer GUI clients, it shouldn't be too hard to import twyt's twitter.py (or commands.py for that matter) and write a nice, shiny front-end for it. I've tried to document it quite well for that purpose - see the GUIHOWTO file for a possible example. Twyt uses the JSON interfaces to the Twitter functions and depends on the simplejson python library.

Have fun.

Page 1 of 1: First Prev Next Last