NewsFeed 1.2 Documentation


Installation

  1. Copy newsfeed.py, rssfinder.py, rssparser.py, and timeoutsocket.py into the Python module path, e.g. to /usr/local/lib/python2.2/site-packages/ or to where your PYTHONPATH environment variable points.
  2. If you have GNOME installed, NewsFeed uses one of the sound files that come with GNOME to alert to new items. The file is also included ("email.wav"). If you prefer another sound, supply the full path in line 28 of newsfeed.py. Putting a nonexistent filename there disables sound notification.
    NOTE: You need to have Snack installed to play sounds.
  3. Copy at least newsfeed and, if you need them, also add_feed.py, feed2opml.py, and opml2feed.py to somewhere in your $PATH.
  4. There is no step 4. That is, unless you want auto-subscription to work, in which case you have to consult your web browser documentation on how to add a handler for specific MIME types or keywords.

NewsFeed uses the Python RSS modules by Mark Pilgrim for the fetching, parsing, and autodiscovery of feeds. Slightly outdated versions of these modules are included in the distribution for ease of use, but newer versions should work as well.

The NewsFeed main window features a familiar three-pane layout similar to many email programs, where in the left vertical pane the newsfeeds and active searches are listed, with buttons right below to move the active feed up and down in the list. Behind the entries the number of unread items in the feed is shown in parentheses. Empty feeds or feeds that did not update correctly the last time (e.g., because of a server timeout) are put in square brackets. Right below the buttons is the progress bar, which is white normally, but shows a green bar when an update is in progress.

Right next to the feed list is the items list for the selected feed, with newest items at the top. Items that were already displayed are shown slightly indented and in parentheses, whereas new, unread items are shown without indentation. If available, the column right next to the one with the subject lines shows the time stamps for the individual messages, or if not available, for the feed.

Below the topic list is the main text area where the description of the selected item is displayed. In the top right corner is again the date as supplied by the feed if available, while in the lower right corner the download date is shown in local time. The article headline is clickable and will open the browser that is set in the BROWSER shell environment variable. (Dillo is a good choice for a browser in this context, as it starts up very fast and displays most pages quite nicely.) Alternatively, pressing o or Return opens the current item. The headline will turn violet if has been visited in the browser. Finaly, the URI of the item is printed in a red font below the text.

The buttons in the top row are:

Note that window positions and sizes get remembered if you move or resize the windows. For the helper windows, this does not work if you close them with their close buttons, you have to do 'Accept' or 'Save', respectively.

Pressing q quits the application, while the Escape key cancels an update in progress (alternatively click the X next to the progress bar).

Additionally, the up and down cursor keys go the previous/next item in the feed, while the left and right cursor keys jump to the previous/next feed and h opens the feed's homepage.

Please also note that the Tkinter bindings to the Tk widget set leak memory when updating widgets or setting timeouts. In other words, the amount of memory occupied by NewsFeed will grow constantly, even if it is idling. Therefore it may not be advisable to leave NewsFeed running for too long (days, weeks, etc.) in a memory-starved environment.

Other features

Also included are three helper scripts:

Files

By default, the configuation as well as the cached data is stored in ~/.newsfeed, while in ~/.newsfeed.pid the PID of the currently running NewsFeed instance is stored. Finally, ~/.newsfeed.addfeed contains new URLs from the helper script and should be processed (and then deleted) by the main program.

As the entire program state is stored in the platform-independent ~/.newsfeed file, one can sync NewsFeed to a different machine or restore a previous state by copying / moving /renaming ~/.newsfeed.

Auto-subscription

In principle, getting auto-subscription, i.e. the appearance of new feeds in NewsFeed when you click on them in the browser, to work would consist in defining add_feed.py as a handler for files with ".rss" extensions. Now, apart from the fact that some feeds have an ".xml" entension, browsers decide on which program to use by MIME type.

Ideally, HTTP servers would be configured to send the MIME type "application/xml+rss" for files with "rss" extensions. Unfortunately, most are not, sending "text/xml" or even "text/plain" instead. This complicates auto-subscription unnecessarily, because Mozilla likes to handle the latter types internally.

Alternative solutions have been discussed at length, for instance prepending a "feed:" to the URI or replacing the "http://" with a "feed://". The add_feed.py script supports all these mechanisms, but since there exists no standard way of auto-subscription right now, expect problems, at least with some servers.

Performance issues

Given that Python is a byte-compiled language and that functional constructs are used heavily by the program, NewsFeed may become sluggish if the individual feeds have a lot of items. In that event, reducing the time for which items from these feeds are cached may be a good idea.

NewsFeed is not multithreaded, so it is generally advisable to leave it alone while updating (as indicated by the white/green status bar in the lower left corner).

Generally, having searches in the feed list slows the program down. Thus, for maximum performace, delete searches when you do not need them anymore.