• Tip Jar

Extending TTYtter

The TTYtter extension pack has been moved to github. The original article and files have been left intact for anyone who wants them. The new way to get the extensions is to open terminal and do the following:
git clone https://github.com/stormdragon2976/ttytter-extensions
To add an extension to your .ttytterrc, the soundpack for example, you would do:
ext=/home/USERNAME/ttytter-extensions/soundpack.pl
And now back to the original article already in progress…
One of the very numerous awesome things about the greatest Twitter client in the world, TTYtter, is its ability to use extensions. extensions are third party add ons for TTYtter that add functionality that hasn’t been included in the TTYtter program itself. One of the things I wanted in TTYtter was sound alerts for the different types of events. So, with some help from TTYtter’s author, Cameron Kaiser, I wrote my first TTYtter extension to add soundpack functionallity. The soundpack goes in a directory in your home folder. If you download the script by itself you may need to create this directory structure. The path to the sounds is:
~/.ttytter/sounds/soundpack-directory
My first soundpack was created using the Espeak speech synthesizer. If you would like, you can download the soundpack. Use the file names as a template to create your own soundpacks. The file names must match exactly. They are:

me.ogg
Sound to play when you post a tweet.
default.ogg
Sound when you receive a new tweet
dm.ogg
Sound when you receive a direct message
search.ogg
sound when you get new results for what ever you are tracking
reply.ogg
sound when someone mentions you

The soundpack can be named anything you like and must be placed in:
~/.ttytter/sounds/
To get your chosen sound pack to load when TTYtter starts, add the line:
extpref_soundpack=sound-pack-name
to your .ttytterrc. Alternatively you can just rename your chosen sound pack to:
default/
and it will load with no modification needed in the .ttytterrc file.
Usually I put all the extensions I use in the ~/.ttytter/ directory so it keeps everything nice and tidy. If you would like to use the full pack of extensions that I use I have created a convenient package that has everything already set up in it. Just extract the folder in your home directory and set up your .ttytterrc file to point to the extensions. If you have previously installed TTYtter using my previous post, you only need to add a line and the notification type for the soundpack. Open terminal and type:
gedit .ttytterrc
Somewhere in the file above the notify information, add the following replacing USER with your user name, the name of your home directory:
exts=/home/USER/.ttytter/soundpack.pl,/home/USER/.ttytter/timestamp.pl,/home/USER/.ttytter/groups.pl
Next find the line that reads:
notifytype=libnotify
and chage it to:
notifytype=soundpack,libnotify
save the file and everything should just work when you open TTYtter.
Included in the pack are the soundpack script, a timestamp script originally written by @vkoser and heavily modified by me, and a groups extention also written by @vkoser. when you install the pack there is a default group created with @ttytter, myself, and some other extention writers in it. If you follow any of us our tweets will be stored in the ttytter group. For help with group commands type:
/grouphelp
If you would like an automated way to create your .ttytterrc using all the extensions then check out http://www.stormdragon.tk/ttytterrc/. Note that it assumes you will be using both libnotify and the soundpack extension. If you don’t want to use libnotify edit the file and remove it from the notifytype line.

TTYtter, an Awesome Console Based Twitter Client

TTYtter is a great command line Twitter client. To get it up and running to its optimal capabilities can take a little work, especially if you would like to get pop up notifications on your desktop with libnotify. So, here is a guide that will show you how to get it all working. Even if you are normally a GUI only sort of person I would still like to suggest you give it a try. TTYtter is my favorite Twitter client. These instructions work on Ubuntu 9.10 Karmic and later and should work on other systems with minimal modification.
If you are a Vinux user, or if you have added the Vinux PPA, you can install TTYtter by opening terminal and typing:
sudo apt-get update
sudo apt-get install ttytter
To install TTYtter manually with readline support and get the curl package open terminal and type:
sudo apt-get install libterm-readline-gnu-perl curl
Arch Linux users also need the perl-term-readkey package:
pacman -S perl-term-readkey
If you use the readline package above you will need to set your PERL_RL variable. To do this open terminal and type:
gedit .bashrc
When the file opens add the following line to the end:
export PERL_RL=Gnu
Save the file and reload it by typing:
source .bashrc
In 1.1.6 and later, you can install a TTYtter specific readline called Term::ReadLine::TTYtter. To do this, go to CPan and download the package. Extract and install the package by opening terminal and typing:
tar xzvf Downloads/Term-ReadLine-TTYtter-1.2.tar.gz
cd TTYtterReadLine/
perl Makefile.PL
sudo make install
Note that the number in the .tar.gz file will change as newer versions are released.
Now, to download TTYtter:
sudo wget -O /usr/bin/ttytter http://www.floodgap.com/software/ttytter/ttytter.txt
sudo chmod 755 /usr/bin/ttytter
If you do not have system wide access save it to ~/bin/ttytter instead of /usr/bin/ttytter and use chmod 700 instead of 755. It may be necessary to create the ~/bin directory.
If you would like to get everything up and running as quickly as possible with extensions from several different authors, you can download the ttytter-extensions pack. Read this article for more infromation. If you install the extensions, you can visit the .ttytterrc generation page to create the .ttytterrc settings file in a few simple steps. When your .ttytterrc file has been placed you can then start the program by typing:
ttytter
in a terminal. For complete instructions on using TTYtter, commands, menu codes, etc please read the TTYtter home page.
If, however, you want to set everything up manually, read on. TTYtter is now installed but missing some of its coolness. If you were to launch it by typing:
ttytter
You would have to also include some arguments to get it going if you want to use things like readline. It’s much better to save this information in a ~/.ttytterrc file. So, here is the ultimate .ttytter file. If you do not plan to use the notifications with libnotify or libnotifyperl you can leave out the notification and exts lines. Copy and paste the following in to a file called .ttytterrc replace USER with the name of your home directory:
#TTYtter settings
#show replies in timeline
mentions=1
#Open images with Eye of Gnome
avatar=eog %U&
#Open URLs with Firefox
urlopen=firefox %U&
#let TTYtter decide how often to check for new tweets
pause=auto
#Use ANSI color
ansi=1
#Check version on start up
vcheck=1
#Number of retries to connect to Twitter
hold=15
#\r and \n create a new line
newline=1
#answer y or Y to post your tweet
verify=1
#use readline support. Change 1 to a list of followers in quotes for tab completion support
readline=1
#Enable word wrap
wrap=1
#Add the libnotifyperl extension
exts=/home/USER/libnotifyperl/libnotifyperl.pl
#Set notification service(s)
notifytype=libnotifyperl
#Set types of tweets for which you would like to receive notifications
notifies=dm,me,reply,search,default
#end TTYtter settings
The newest method of getting desktop notifications doesn’t require patching libnotify. You can still use that method if you would like, and the instructions are left for reference below this new method. The new way is to use an extension written by Colindean which does notifications using Gtk2::Notify. To get it:
sudo apt-get install git-core libgtk2-notify-perl
make sure you are in your home directory by typing:
cd
and then do:
git clone http://github.com/colindean/ttytter-libnotifyperl.git
The old way to enable notifications takes a little more work. The notify-send package is available from the repository, but for some reason a patch that
adds required functionality has not been added in to the distributed version. So, instead of using the standard package, we have to roll our own. If you are not sure if you already have it installed, in terminal type:
sudo apt-get remove libnotify-bin
To build the libnotify-bin package and apply the patch type the following in terminal:
cd
apt-get source libnotify-bin
sudo apt-get install gtk-doc-tools
sudo apt-get build-dep libnotify
then download this patch. You will probably need to right click the link and select "save link as". After the file has finished downloading:
cd libnotify-0.4.5/
The number in the directory name above may change as new versions are released. If you type libnotify and press tab it should complete the name, then press enter to get in to the directory. Then, apply the patch. My files save in ~/Downloads if your files download to another location you will need to alter the path in the next command to point to the downloaded file:
patch -p0 < ../Downloads/notify-send-support_body_from_file.patch
./autogen.sh
make
sudo make install
I had to restart before notifications worked as expected. Now TTYtter is installed and should work with its ultimate coolness factors enabled. Enjoy, but be warned, TTYtter will be your new favorite Twitter client after five minutes of use. For instructions check out http://www.floodgap.com/software/ttytter/.

  • Tip Jar