24 September 2006

News Bins

Version 1.1.6 will introduce "news bin" support. A feature that can be found in many of the advanced commercial aggregators, which is a good reason to have it too :-)

If you don't know what a "news bin" is about: well it's like a container which you can use to collect items from the feeds you read. It is similar to the flagging feature (items with set flag are never deleted). It will also allow you to permanently keep items, but additionally you can create multiple news bins for different item categories. Also in difference to flagged items: items in news bin are not deleted when you delete the original feed.

22 September 2006

Choosing the right scripting language

First thanks to everyone who gave feedback and suggestions on the scripting post!

I think most of the "advanced" users (hey, I didn't say geeks!) agree that it would be nice to have such a feature. The killer argument of course is the NetNewsWire has it too. The real problem is which scripting language to choose.

There are several soliticing candidates:
  • Python: because it's widely used in GNOME and Liferea is often used in a GNOME environment.
  • Perl: because it can be found on almost every serious Unix installation
  • LUA: because it never crashed my favourite Angband variant while I was fighting evil mass summoners on level 97 after running three days and several million turns.
  • Javascript: because Liferea uses Gecko/XPCOM anyway
But there are contra arguments:
  • Python: 15% of the users won't have it installed, another 35% will hate programs forcing them to install it
  • Perl: 5% of the users won't have it installed, maybe 15% will hate programs forcing them to install it
  • Python+Perl: many unnecessary language features and function modules
  • LUA: pretty unknown, it's is rarely installed per default
  • Javascript: doesn't work with the GtkHTML2 rendering module, and XPCOM might scare you
How to decide?

Of course the percentages given above are just some guessed numbers. But I think they illustrate the problem that using a standalone interpreter language, no matter how sophisticated and object oriented, will leave some users without scripting support. The advantage on LUA and Javascript is that as a compile time library dependency each will be available when the program itself is usable. If it is not then it is a problem of the package maintainer who needs to ensure the correct dependencies.

Scripting Support Plugins

In the end there is no really obvious candidate. I think for a GNOME-related program either Python or a very simple embedded-only scripting language are most suited. And therefore I'll stay with LUA. But I realized it as a scripting support plugin and it should be really simple (patches are welcome) to write an alternative Python support plugin. The advantage of having plugins is also that maintainers can provide optional scripting support packages with the correct dependencies.

11 September 2006

Experimenting with Scripting Support

This weekend I added LUA scripting support to SVN trunk. I'm not sure wether this is a good and very useful idea but I just wanted to try and see how things work out.



The current code allows to open the "Script Manager" window (screenshot) from the "Program" menu. When opening for the first time there should be no scripts registered. Everything should be empty.

The idea is that you select a scripting hook (the option menu at the top) and add one or more scripts that are to be called when the hook is triggered. Currently supported hooks are:
  • Startup
  • Feed updated
  • Feed selected
  • Item selected
  • Feed unselect
  • Item unselect
A script registered for one of these hooks will probably always modify one or more of the currently selected item(s) or feed(s). The currently possible actions are limited by the generated LUA binding. Which is created using SWIG. Currently there are bindings for item.h, node.h, itemlist.h and feedlist.h which should allow to execute all item, feed and feedlist modifications from within LUA.

A simple and useful example is shown in the screenshot. It addresses a feature I was asked for several times, but which was never implemented as an seperate preference. The feature is to mark all items of a feed as read once it is unselected.

To do this a script for the "feed unselect" hook is added. It uses the "liferea" LUA module which maps all functions from the includes mentioned above. So it simply calls feedlist_get_selected() to determine the node that is to be unselected and calls node_mark_all_read() for this node.

What do you think about scripting support? Would you use it? Ideas for other use cases?

07 September 2006

Integrating Liferea with Firefox

Want to easily add subscriptions from within Firefox? You don't really need the live bookmarks feature of Firefox? Then FeedBag is the solution.

FeedBag is a very simple Firefox 1.5+ extension that changes the live bookmark subscription icon in the URL entry to add subscriptions to Liferea instead of creating a new live bookmark subscription.

To do this FeedBag relies on DBUS to send subscription requests to Liferea. So if it stops working please check that both Firefox and Liferea are started from within a DBUS enabled environment.

You can find FeedBag on addons.mozilla.org but you can also find the XPI on the SF project page or in the source tarball.

06 September 2006

Social Bookmarking with Liferea

Version 1.1.2 introduced social bookmarking support! Now you can configure Liferea to post links to one of 43 social bookmarking sites. The default setting is to use del.icio.us. To configure another site open the preferences select the "Headlines" tab and change the option under "Web Integration".

To post a bookmark new menu options were added to the item list and HTML view context menues. You can either bookmark an item by right clicking it in the item list and selecting "Bookmark Item" or you can bookmark any link in the HTML view by right clicking the link and selecting "Bookmark Link".

Depending on the social bookmarking site and its URL posting interface the item title will be passed as link description. But not all sites support this. When bookmarking links no title will be supplied.

Finally one might ask why the bookmarking sites are launched in the external browser only. There are two reasons:
  1. Some of the sites use HTTPS and Liferea doesn't set up the security manager for Gecko, so secure connections won't work with the internal browser.
  2. And launching in the external browser, assuming it is the browser used for normal web surfing, ensures correct auto-login to the bookmarking side.
Well this is how it is implemented. I hope it will be useful for a lot of users.