But you probably will prefer to read thhe news when off-line (lets say in bus or in train). How to save a link an interesting article that you want to read later?
The solution is simple: the “SnowNews” can start a web browser (it´s the “o” keyboard shortcut) and you can replace the browser command with a custom shell script which will save the link for you.
It would be ideal if after the “o” key you will get a dialog with options to save the link, open it in the browser or download it to the disk.
It may look as a complicated task but you may use the program shown below.
To to thinks work you have to do this:
- Save the code below as a file /usr/bin/br-wrapper
- make it executable:
chmod +x /usr/bin/br-wrapper
- edit the file .snownews/browser in your home directory (most probably it is a /root/.snownews/browser file) so it will include this:
- try it
The br-wrapper file can look like this:
#! /bin/ash export DOWNDIR=/tmp export LINKFILE="/root/links.html" export TERM=vt100 export A=`dialog --backtitle "RSS feed options" --menu "Select action" 10 30 8 1 "Download" 2 "Open in Browser" 3 "Save Link" --stdout` if test $A = 1 then mkdir $DOWNDIR cd $DOWNDIR && wget $1 exit 0 elif test $A = 2 then links $1 exit 0 else echo ''$1'
' >>$LINKFILE exit 0 fi
Some notes: downloaded files will be saved in the /tmp directory which is erased on every shutdown or restart. So you probably will want to use differen directory (say /root/downloads). So create the directory and change its name in the script.
Also please note that only the Save link option work when you are off-line.
If you have found the line export TERM=vt100 to be unnecessary you are right. I only put it here to get more consistent look: the “SnowNews” is mostly black and white so the dialog should be in those colors, too. And setting the terminal type to an old good black and white VT100 is the easiest way how to do it.