Monday, 14 March 2011

Introducing pwntter

I discovered a great little CLI based twitter app called TTYtter a couple of days ago and discovered, i) it is written using Perl, and, ii) one can write extensions for it. For a gentleman with some free time over a weekend, this is a Bad Thing™.

Having a read through the TTYtter documnentation, I discovered that it was an extraordinarily flexible little tool and one could also run it in daemon mode. Which then made me think that storing my twitter stream into a MySQL database would be a Good Thing™.

So, here is the result of my efforts, namely, pwntter. I am adopting the maxim "Release early, release often" with this project and am hosting it in a Google Code repository.


What you need

  • A Perl interpreter.
  • The following CPAN modules: DBD::mysql, Date::Manip and HTML::Entities.
  • A working installation of TTYtter.
  • To read the TTYtter documentation. And then read it again. And again, probably.
  • A MySQL database.


Installing pwntter

Download and unpack project from the download section.

Create or use an an existing MySQL database and execute the pwntter.sql file. The self-explanatory table names are: users, tweets and direct_messages.
Edit pwntter.pl with hostname, database, userid and password for your MySQL database:

# mysql database config.
my $host = "localhost";
my $db = "pwntter";
my $user_id = "mysqluserid";
my $password = "mysqlpassword";
`

If they are not already installed, install Perl modules DB, Date::Manip and HTML::Entities.

Run TTYtter with the pwntter extension. For example:ttytter -exts=pwntter.pl -hold -daemon
Fill your database.





Screenshot

Ha! It really doesn't do anything graphical or textual. Here's a query instead...

0 comments: