Since comp.infosystems.gopher has been a little quiet lately..
--code--
#!/bin/sh -e
# gotel - surf Gopherspace via telnet(1), one link at a time. Supports Gopher
# Types 0 (file), 1 (dir), and 7 (query) retrieval. Gopher port (70) and
# plain text output assumed. NetBSD native telnet(1), sed(1), and rev(1)
# used; edit as needed for other systems.
#
GHOST="$1"
GLINK="${2:-/}"
if [ "$#" -eq 0 -o "$1" = "-h" ]; then
echo '
usage: % gotel floodgap.com [/] => returns "/" (root) directory
% gotel floodgap.com /v2/vs?ascii => returns "ascii" Veronica search
% gotel floodgap.com /users[/] => returns "/users" directory
% gotel floodgap.com /ptloma => returns "/ptloma" file
[/] suffix optional but produces cleaner directory listings.
'
exit 0
fi
clear
if [ "$(echo $GLINK |rev |cut -c1)" = "/" -o -n "$(echo $GLINK |grep '?')" ] ;then
printf "\n
gopher://${GHOST}/1${GLINK} \n\n"
(sleep .5 ;echo "$GLINK") |telnet $GHOST 70 2>/dev/null |\
sed -E '1,/^Escape character /d;$d;s/^./& /;/^i/s/TAB.*$//;s/.70$//' |more else
printf "\n
gopher://${GHOST}/0${GLINK} \n\n"
(sleep .5 ;echo "$GLINK") |telnet $GHOST 70 2>/dev/null |\
sed -E '1,/^Escape character /d;$d' |more
fi
echo ''
--/code--
You'll need to replace the TAB in the sed(1) line with a literal TAB or
use gsed(1) and replace TAB with '\t'. Script was mostly wriiten for ammusement but it does seem to work okay on a number of gopher servers
(tested on Bucktooth, Gophernicus, and geomyidae).
Uptime 5:19 -- time for a walk..
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)