#!/bin/sh

# phew - a (p)erl (h)acker's (e)xiguous (w)eb browser
#
# * $b nonsense is to avoid using \ directly, which trips up some forms
# * requires netcat and html2text
# * use inside gnu screen for extra mileage

while eval; do read -e -p "http://" u; echo $u | perl -ne '$b=chr(92); print qq[echo -e "GET $2 HTTP/1.0${b}r${b}nHost: $1${b}r${b}n" | nc $1 80 | ] . ($3 ? $3 : "html2text | less") if m|^([^/]*)(/?\S*)( .*)?$|' | sh; done