|
NAMEfvwm-menu-headlines - builds headlines menu definition for fvwmSYNOPSISfvwm-menu-headlines [ --help|-h|-? ] [ --version|-V ] [ --info [site] ] [ --site|-s site ] [ --name|-n name ] [ --title|-t title ] [ --item item ] [ --exec|-e exec-command ] [ --command|-e fvwm-command ] [ --icon-title icon ] [ --icon-item icon ] [ --icon-home icon ] [ --icon-error icon ] [ --wm-icons ] [ --frontpage [where] ] [ --proxy|-p host:port ] [ --file [file] ] [ --fake [file] ] [ --timeout seconds ]DESCRIPTIONThis configurable perl script builds an fvwm menu definition for headlines of popular news web sites: FreshMeat, Slashdot, LinuxToday, DaemonNews, GNOME-News, KDE-News, RootPrompt, LinuxFr, ThinkGeek, CNN, BBC and more.It is possible to specify a customized menu item format, change a command (usually launching a browser) and add menu icons (there is a support for the wm-icons package). OPTIONS
WORK_HOME of this script is ~/.fvwm/.fvwm-menu-headlines. It is created if needed. Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: "-h", "-t"; but be careful with short options, what is now unambiguous, can become ambiguous in the next versions. USAGE1. One of the ways to use this script is to define a crontab entry to run the script every hour or so for every monitored site:0,30 * * * * fvwm-menu-headlines --file --site freshmeat 1,31 * * * * fvwm-menu-headlines --file --site linuxtoday 2,32 * * * * fvwm-menu-headlines --file --site slashdot Then add these lines to your fvwm configuration file: DestroyFunc FuncFvwmMenuHeadlines AddToFunc FuncFvwmMenuHeadlines + I Read "$HOME/.fvwm/.fvwm-menu-headlines/$0.menu" DestroyMenu MenuHeadlines AddToMenu MenuHeadlines "Headlines" Title + MissingSubmenuFunction FuncFvwmMenuHeadlines + "FreshMeat" Popup freshmeat + "LinuxToday" Popup linuxtoday + "Slashdot" Popup slashdot 2. Another way to use this script (only if you have fast network/proxy) is to run it every time you want to open your Headlines submenus. (Note, the submenu that is once created is not reloaded, use "Reset all".) In this case your fvwm configuration lines could be: DestroyFunc FuncFvwmMenuHeadlines AddToFunc FuncFvwmMenuHeadlines + I PipeRead "fvwm-menu-headlines --site $0" #+ I Schedule 900000 DestroyMenu $0 # reset generated menu in 15 minutes DestroyMenu MenuHeadlines AddToMenu MenuHeadlines "Headlines" Title + MissingSubmenuFunction FuncFvwmMenuHeadlines + "FreshMeat" Popup freshmeat + "Slashdot" Popup slashdot + "LinuxToday" Popup linuxtoday + "GNOME News" Popup gnome-news + "KDE News" Popup kde-news + "" Nop + "Reset all" FuncResetHeadlines DestroyFunc FuncResetHeadlines AddToFunc FuncResetHeadlines + I DestroyMenu freshmeat + I DestroyMenu linuxtoday + I DestroyMenu slashdot + I DestroyMenu gnome-news + I DestroyMenu kde-news And finally, add "Popup MenuHeadlines" somewhere. 3. Here is a usual usage. Use FvwmConsole or FvwmCommand to run fvwm commands from a shell script. Every time you want headlines from some site, execute (give any additional options if you want): PipeRead "fvwm-menu-headlines --site newsforge --name MenuHeadlinesNewsForge" # this may take several seconds, you may use: BusyCursor Read true Popup MenuHeadlinesNewsForge HOW TO ADD SITE HEADLINESIt is possible to add user defined site headlines without touching the script itself. Put your perl extensions to the file WORK_HOME/extension.pl. For each site add something similar to:$site_info->{'myslashdot'} = { 'name' => "MySlashdot", 'host' => "myslashdot.org", 'path' => "/myslashdot.xml", 'func' => \&process_my_slashdot, # the following string is only used in --info 'flds' => 'time, title, department, topic, author, url', }; sub process_my_slashdot () { return process_xml( 'story', # mandatory 'h', 'u' and 'd' aliases or undef { 'h' => 'title', 'u' => 'url', 'd' => 'time' }, sub ($) { # convert 'd' string to (y, m, d, H, M, S) $_[0] =~ /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/; ($1, ($2 || 0) - 1, $3, $4, $5, $6); }, +0, # timezone offset; already in UTC ); } 1; AUTHORSThis script is inspired by WMHeadlines v1.3 by:Jeff Meininger <jeffm@boxybutgood.com> (http://rive.boxybutgood.com/WMHeadlines/). Reimplemented for fvwm and heavily enhanced by: Mikhael Goikhman <migo@homemail.com>, 16 Dec 1999. COPYINGThe script is distributed by the same terms as fvwm itself. See GNU General Public License for details.BUGSI try to keep all supported site info up to date, but sites often go down, change their backend formats, change their httpd responses, just stop to post news and so on; the script in the latest cvs may be more up to date.The headline times may be off by one hour or more, since the time is displayed for your local time zone, and the time zone of the original time in the site backend output is often guessed (sometimes incorrectly); similarly it is guessed whether to apply the daylight saving correction. Report bugs to fvwm-bug@fvwm.org.
Visit the GSP FreeBSD Man Page Interface. |