announce: ob3_headlines; rss/rdf feed menu
Mike
logan at dct.com
Thu Oct 2 02:53:20 EDT 2003
Hey,
Was bored, so I made another pipe-menu thinger. :P
http://www.gozer.org/my_stuff/c/c/ob3_headlines.c
ob3_headlines is like the *headlines menu scripts for other window managers. Grabs RSS/RDF feeds from various webservers for display in the menu. It requires openbox3 libraries/includes and libcurl (http://curl.haxx.se).
A number of default feeds exist, but custom feeds can be added as well.
# created after the first run
~/.config/openbox/.ob3_headlines/rc:
command = mozilla -remote openURL(%s,new-window)
feed_ttl = 900
feed = Example_Feed1|||http://example.com/feed.rss|||rss
feed = Example_Feed2|||http://example.com/feed.rdf|||rdf
Currently only RSS/RDF is supported. Custom feeds must contain: name, url, and type (rss or rdf). I've no problem with adding other feed types, so long as they are workable with parse_load() and preferably not needing too many other changes to the existing code.
I looked at fark's feed, but it was different enough from the other rss/rdf feeds I've seen to be annoying, so there's no <fark></fark> support. :P
Feed data is downloaded to ~/.config/openbox/.ob3_headlines/cache/, refreshing after 15 minutes (default).
# menu examples for freshmeat and slashdot
~/.config/openbox/menu.xml:
<menu id="ob3_headlines-freshmeat" label="Freshmeat"
execute="ob3_headlines freshmeat" />
<menu id="ob3_headlines-slashdot" label="Slashdot"
execute="ob3_headlines slashdot" />
The feed lookup is not case-sensitive. Run with no args to see a list of available feeds or usage.
A note about the default browser command for Mozilla(Firebird)... Depending on the installation of mozilla (maybe some binary packages include a nice script?), mozilla -remote openURL(%s,new-window) might not work if another instance of mozilla isn't already running.
In that case a simple script could be created to work regardless, like:
ob3_moz.sh:
#!/bin/sh
mozilla -remote 'openURL('$1',new-window)' || mozilla "$1"
Then just update the rc to use: ob3_moz.sh %s (or whatever ya call it).
Feedback is welcome. :)
Mike
More information about the openbox
mailing list