[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Spectrum Internet Suite technique
I believe I've finally figured a full script using ONLY standard
UNIX utilities which will do the same thing as SIS. Posted purely
FYI, you need SIS for the html parsing, which this doesn't provide.
Since this was posted before I even touched SIS or any of its
documentation, you can be sure no reverse engineering was done.
By the way, this will NOT work as a shell script. You'd need
expect to do that, and expect is not available on all UNIX systems.
Each command can be typed from the command line, however.
# This is the URL...
set request=http://www.vuse.vanderbilt.edu/
# This is the host which was extracted from the URL...
set host=www.vuse.vanderbilt.edu
# This is the default port for www, overridden if specified in the URL...
set port=80
# tee is used to make sure we get the output (dunno if necessary or not)...
telnet $host $port | tee /tmp/telnet.file > /dev/null
GET $request
# This part is only necessary if the output was bin (e.g. jpg)...
# It gets rid of some initial stuff which is not actually part
# of the request.
set preprelen=`wc -l /tmp/telnet.file`
set prelen=$preprelen[1]
set len=`expr $prelen - 3`
tail -$len /tmp/telnet.file | uuencode telnet.file > /tmp/telnet.uue
# We may want to use 'sz' for a reliable xfer... otherwise, we
# may need to 'split' the file up into chunks, and 'cat' each
# one separately to stdout (us). 'split' is only necessary if
# the file is above a certain size.
# This part is VERY important.
rm /tmp/telnet.file /tmp/telnet.uue
--
__ __|_) | |
| | | _` | \ ` \ _` | \
_| _|_|\__, |_| _|_|_|_|\__,_|_| _|
____/