Here's a quick attempt, I've just got in from a 12 hour shift at work and I am knackered...
dialog web2dlg {
title "Web 2 Dialog"
size -1 -1 153 98
option dbu
edit "", 1, 2 2 147 93, multi hsbar vsbar
}
alias web2dlg {
if ($1) set %find $1
if (!$dialog(web2dlg)) dialog -dm web2dlg web2dlg
sockopen web2dlg www.some-site-here.com 80
}
on *:sockopen:web2dlg: {
sockwrite -n $sockname GET /somefile.txt HTTP/1.1
sockwrite -n $sockname Host: www.some-site-here.com $+ $crlf $+ $crlf
}
on *:sockread:web2dlg: {
if ($sockerr) {
halt
}
else {
var %w2d
sockread %w2d
if (%find) {
if (%find isin %w2d) {
did -a web2dlg 1 $strip(%w2d) $crlf
}
}
else {
did -a web2dlg 1 $strip(%w2d) $crlf
}
}
}
on 1:sockclose:web2dlg: {
echo -a Connection to Web 2 Dialog closed.
unset %find
}
Usage:
/w2d - Lists the entire file if no keyword was used.
/w2d <keyword> - Lists all lines in the dialog with that keyword.
You may change the website, and file to whatever and if you know how sockets work you may change that name too.
-Andy