Twitter reader and personal manager

TweeTabs Tutorial

Note: These notes, while not far from the truth, are not completely synchronous with the current status of the program. For precise details, see the TweeTabs Reference, which is updated more often.





1   Basic usage

To get started with TweeTabs, you should first install the program and open a Twitter account if you do not have one already. The program needs a bit of configuration before the initial call. Once started, the usage is fairly simple, as explained below.

1.1   Installing TweeTabs

  • TODO: Explain how to, based on the Installation section within the TweeTabs Reference.
  • TODO: Package a zip and / or tar.gz distribution, so git is not required.

TweeTabs depends on Python, pygtk, twyt  (at least version 0.9.2, some notes within python-twyt, including a reference for simplejson).

1.2   Opening a Twitter account

  • TODO: Give some pointers, and a very quick sketch.

1.3   Configuring TweeTabs

Now suppose your Twitter user name is My User Name and your associate Twitter password is YoullNeverGuessIt. Make sure that you have a ~/.tweetabs directory, maybe by executing the following commands into a terminal emulator:



mkdir ~/.tweetabs




Then, using a simple text editor, create a file named defaults.py in this directory, which contents should be:



Twitter.user = 'My User Name
'

Twitter.password = 'YoullNeverGuessIt
'

Of course, in the above, you ought to replace your user name and password appropriately. Make sure you keep the quotes, however.

A final precaution is to make this file unreadable by others, because it contains a password. This could be done with the commands:



chmod 600 ~/.tweetabs/defaults.py




You are now all set for TweeTabs.

1.4   Launching TweeTabs

TweeTabs requires a bitmapped display like what is offerred by the X Windows system on Linux and other Unices. I merely guess that it should works well under MS Windows or MacOSX, but the truth is that I do not know. TweeTabs will definitely not work within a Linux so-called virtual console.

One way to launch TweeTabs is to open a terminal emulator window, and to give the command tweetabs to the shell, without any arguments. This should quickly open another window running the TweeTabs application.

1.5   Interacting with TweeTabs

By default, TweeTabs shows two tabs. One is named Me… and the other is named Friends. These normally get loaded with tweets soon after the program starts. By merely clicking on a tab label, you switch to displaying the tweets in that tab, hiding all the tweets in the other tab.

The Me… tab shows the tweets you recently sent, as well as the replies you might have received from others. The Friends tab shows all recent tweets written by those you elected to follow. Refreshing is not as instantaneous as in many other chat systems. If someone writes a tweet, it may take one or a few minutes before you actually see the tweet displayed in the appropriate tab.

For sending a tweet, you have to position the cursor in the input area near the bottom of the TweeTabs window, and just type your tweet in there. As long as you do not hit the Enter key, you may edit and correct your tweet. When you hit Enter, the tweet is submitted immediately.

If somethings goes wrong for any reason (for example, you do not have Internet connectivity, or Twitter is slow to reply), some diagnostic displays in red near the bottom of the TweeTabs window. In most cases, unusual conditions clear up by themselves, so you should not be overly alarmed by such diagnostics.

To quit TweeTabs, either use the File → Quit menu at the top, or destroy the TweeTabs window like you do for other windows (often by clicking over some ✗ at the upper right).

That's all you really need to know for using TweeTabs. The remainder of this tutorial addresses more advanced topics. So, if you are fully happy with the above, you may stop reading now! ☺

2   Compositing Tabs

2.1   Tab unions, dynamic tabs

The Me… tab combines in fact the contents of two other tabs, which are its inputs. The Me… tab inputs are hidden when the program starts, so you do not see them. They may be revealed by using Tab → Select → Add inputs from the top menu, while the Me… tab tweets are currently displayed. You'll then get a User tab and a Replies tab.

You might observe that the new tab labels are written in red. This is just a way to indicate that these tabs are now selected and ready for further advanced operations. As you probably do not mean such operations right now, merely clear by using Tab → Select → Clear all from the top menu. The tab labels return to their normal color.

Why these input tabs? What is happening here? Under the rug, the User tab is really the one which is updated, once in a while, from the Twitter site. The Replies is updated as well from the Twitter site, yet not necessarily at the exact same time the User tab is updated. In fact, each of these two tabs has its own means and life.

The Me… tab, on the other hand, is not directly updated from the Twitter site. It is instantly updated from both the User tab and the Replies tab. That is, when any of these input tabs change for any reason (when newer tweets are received from the Twitter site, when older tweets are deleted to respect the tab capacity, or when you interactively delete or add tweets in them), the Me… tab immediately and dynamically reflects the changes. The Me… tab is a union tab with two inputs, which means that it reflects all the tweets from either input.

Next to any tab label, there is a number written in grey color. This number is merely the tweet count within the tab. You may sometimes notice that the number of tweets in a union is smaller than the sum of the number of tweets in all inputs. This happens when one tweet appears in more than one input, because that tweet is counted only once in the resulting union.

2.2   Tab copy, arguments selection

Let's practice a bit more, and create a tab merely copying the tweets from another tab. To achieve this, we will use the fact that when a union tab has a single input, its contents are the same of the contents of this input.

Make sure that no tab is selected, that is, no tab label shows in red. Also, make sure the Me… tab is the current tab. Using the top menu, do Tab → Compose → Union. This creates the wanted tab, and you may readily check that it has exactly the same tweets as Me… Moreover, whenever Me… gets periodically updated, the new tab gets updated as well.

If you feel like toying, you might create a copy of the copy, and a copy of the copy's copy, and repeat the operation many times, so creating a chain of copies, a lot of tabs, and eventually, some updating overhead while creating tons of widgets.

Because no tab was selected, the composition used the current tab for its sole input. This is a common behaviour in TweeTabs, selecting only the current tab or selecting no tab at all are equivalent. We already used this property earlier in the tutorial when we tried Tab → Select → Add inputs: this then added to the (empty) selection the inputs of the current tab.

Alternatively, you could have explicitly selected the current tab prior to the composition, by using either Tab → Toggle select or Tab → Select → Toggle select (the former is merely a convenience for the latter). Try it! You might observe that after selection, the current tab label turns red, but after the creation of the copying tab, that label turns back to its normal color. This is also common behaviour in TweeTabs: after an operation, the selected arguments are automatically deselected.

This is not always true however. The Tab → Select → Add inputs is one such exception, it adds to the selection all inputs from all selected tabs, without clearing the selected state of the argument tabs afterwards. So, by repeating the operation a few times, you'll obtain all input tabs, direct or indirect, for the starting tab. If you decided to play and create a long chain of copies, above, you may experiment this a bit deeper.

By the way, you might have noticed that the created tab are named Union, Union2, Union3, etc. Indeed, tabs all have distinct names. If you attempt to rename a tab to a name which already exists, a number is automatically added to your suggestion, so to make the name unique.

2.3   Tab intersection

Union is only one of TweeTabs' compositions. Let's now try creating an intersection tab, whose contents are to be the only tweets simultaneously common to all inputs. For compositing a new tab, you have to select the inputs first. For example, assuming that no tab is selected, make the Me… tab current and do Tab → Toggle select from the top menu. Then, make the Friends tab current and do Tab → Toggle select again.

Notice that both tabs now have red labels, these will be the arguments to the next operation. Command Tab → Compose → Intersection from the top menu, and voilà, you now have a new intersection tab, likely containing no tweets at all. The tab arguments have been deselected, and the freshly created tab is now current.

2.4   Tab difference, frozen tabs

You can take the difference between a tab and many others. This will yield all tweets in the first argument tab, as long as they do not appear in any other argument tab. This operation differs from those we have already seen in a few aspects, worth noting here.

All argument tabs are not equal. The first input is positive in that it brings new tweets to the result, all the others input are negative in that they substract tweets from the result. So, while selecting tabs as arguments, the positive tab has to be noted especially. The trick is that the current tab is the positive input, while all other selected are the negative inputs. In practice, it means that you select all negative inputs first the usual way, that is, making a negative tab the current tab and toggling it selected. Once all negative inputs have been designed, make the positive tab the current, and only then create the difference.

As an illustrative example, presume you want to monitor in a separate tab those tweets that will arrive in the current tab from now. You want to see new tweets only, without the tweets which are currently displayed. That is, only newer tweets.

The trick is to take the difference of the current tab with a frozen copy of it. This means three steps: you copy the current tab, you then freeze that second tab, and finally, you create a third tab as being the tweets of the current tab minus the tweets of the second tab.

A frozen tab is merely a tab which has been made temporarily immune to its inputs. Any change within the inputs will have no immediate effect on a frozen tab, those effects are all delayed until the tab gets unfrozen back, later. When a tab gets unfrozen, it immediately catches up on all changes in its inputs.

Let's try it for the Friends tab. With nothing selected, make the Friends tab current, then do Tab → Compose → Union. This automatically creates a copy and switches to it. The next step is to do Tab → Configure → Toggle frozen. The tab label changes to use a leaner font, indicating a now frozen tab. By using Tab → Toggle select, we mark this tab as a negative input. Now, make the Friends tab current again, then do Tab → Compose → Difference. You now have an empty tab representing the wanted difference. As soon as new tweets will arrive in Friends, these, and these only, will appear in the difference tab.

In practice, you do not keep your eyes fixed on an empty tab, this is not an interesting thing to do! You go to other tabs, at your will. As long as you see the new tab label, you may monitor the number of tweets it contains. When this number gets different from zero, you may get back to the difference tab and read the new tweets in there. Once you are done reading them, you may go to the frozen tab and do Tab → Configure → Toggle frozen twice. This catches up, resets the difference to empty, and starts the monitoring over again, but from now this time.

Here comes a few more technical words on technical aspects on differences, which you may choose to skip.

On average, TweeTabs do not fear loops between tab connections. You may build a sequence of inter-connected tabs in such a way that a tab eventually has itself as input. There is no danger of infinite propagation of tweets between tabs, rather, the system quickly stabilizes. However, this is not true in negative input contexts, where through a negating tab connection loops, tweets may get infinitely added, then removed, from a single tab. So, as a measure of precaution,TweeTabs harshly forbids that the output of a difference tab reaches one of its negative inputs, even if a deep analysis of a particular setup might prove that, through double negation, it would make sense.

The function Tab → Select → Add inputs has been discussed a few times before. However, for the sake of clarity in the case of a difference composition, the positive input has the tab label colored in red, while the negative inputs have the tab label colored in magenta. The different color is only for users to observe, it has no consequence other than visual, and all inputs, either positive or negative, are equally added to the selection.

3   Friends and followers

You receive those tweets written by your friends — or from your following in Twitter parlance. Those tweets you write are received by your followers. Try either Tab → Users → Followers or Tab → Users → Following. You'll get an alphabetical list of your followers or friends.

Notice that the strips in tab you get describe users, not tweets, even if the format is vaguely similar. The same as you may compose tabs of tweets into a new tab of tweets, you may compose tabs of users into new tabs of users. But you may not create, for example, a union tab out a tab of tweets and a tab of users at the same time, as tabs should contain strips of only one kind.

If you have many friends and followers, TweeTabs may require hours for listing them fully, at least the first time through. The reason is that Twitter does not allow more than 100 requests each hour. While fetching the information for your friends and followers, TweeTabs makes a request for a single user information every ten seconds or so, but slows itself down even further as the limit approaches, trying to leave enough room for the other usual operations. You might open Tab → Users → Following, and also Tab → Users → Followers, even if you do not need them. This should trigger TweeTabs into progressively rebuilding its user cache while you do other things. When the user information is missing, a user tab only shows the user id next to a white image, and because numbers precede letters, incomplete user tabs tend to group at the beginning of the tab.

Moreover, even when all the information is available in the local database caches, TweeTabs may require many seconds, even minutes, for creating all the widgets and formatting the text for long lists of users. So if you have many contacts, be patient. You should be anyway! ☺

By composing the above tabs with the difference operator, you may easily obtain a tab showing people you follow and who do not follow you back. And also, the people following you, and for whom you did not reciprocate. Try both of these, it would help you mastering how to build differences.

4   More tricks

Here are few random tricks using TweeTabs, presented in no particular order.

  • The whole spirit behind TweeTabs is to combine almost empty tabs, meant to contain interesting tweets, with other tabs from other computations, also holding interesting tweets. You manage so to have a single main tab of interest overall, which subsumes other choices or computations you organized in other tabs. You keep that main tab displayed, and go to its sources only where there is a need to do some finer grain analysis.
  • There is no menu entry for selecting all tabs, or all strips within a tab. For selecting everything, first use Select → Clear All, just in case you would have something selected already, then use Select → Inverse.
  • If you do not want TweeTabs to open tabs on startup, leaving to you to do it explicitly, you might use option -n. You might want that TweeTabs never open tabs on startup. If this is the case, there is a way so -n will not be needed anymore. Merely create an empty ~/.tweetabs/tabsetup.py file. When that file exists, the default tab setup is inhibited and that file drives the initial tab layout instead. In particular, when the file is empty, nothing happens.
  • Currently, Strips → Sort all removes all strips and inserts them again, in the proper order. I suspect it might be faster to do it this way for tabs containing lots of strips. This has the side-effect of fully refreshing a tab's contents, even if it was already sorted. This might be useful to know for restoring a garbled screen. But why would one get a garbled screen anyway?! ☺

The TweeTabs Reference is meant to say everything an advanced user needs to know, yet without examples, you need to be imaginative. Please tell me any practical and interesting example which come to your mind, I might even include it in this tutorial page.