From: Sean Brady
Subject: Getting an HTML page using LISP
Date: 
Message-ID: <36574ed9.16059163@news.thegrid.net>
I am trying to get the HTTP-CL server running basically so that I can
get pages off the web.  I don't need any of the server functionality.
I was hoping someone could point me to some code which just creates a
connection to the web and lets me get HTML pages.  I want to use this
for my AI class but don't have the time to figure out how the server
works.

Thanks in advance.
Sean Brady

From: Rainer Joswig
Subject: Re: Getting an HTML page using LISP
Date: 
Message-ID: <joswig-2211981639050001@194.163.195.67>
In article <·················@news.thegrid.net>, ······@calpoly.edu wrote:

> I am trying to get the HTTP-CL server running basically so that I can
> get pages off the web.  I don't need any of the server functionality.
> I was hoping someone could point me to some code which just creates a
> connection to the web and lets me get HTML pages.  I want to use this
> for my AI class but don't have the time to figure out how the server
> works.
> 
> Thanks in advance.
> Sean Brady


? (with-output-to-string (stream) 
    (http:show-url "http://www.symbolics.com/"
                   :stream stream))
"
<HTML>
<HEAD>
<BASE HREF=\"http://stony-brook.scrc.symbolics.com/www/\">
<TITLE>Symbolics Technology, Inc.</TITLE>
</HEAD>
...

-- 
http://www.lavielle.com/~joswig
From: Lily Pad
Subject: Re: Getting an HTML page using LISP
Date: 
Message-ID: <antispam-2411980149560001@pool1-30.max1.ahn.dialup.athens.net>
>In article <·················@news.thegrid.net>, ······@calpoly.edu wrote:
>
>> I am trying to get the HTTP-CL server running basically so that I can
>> get pages off the web.  I don't need any of the server functionality.
>> I was hoping someone could point me to some code which just creates a
>> connection to the web and lets me get HTML pages.  I want to use this
>> for my AI class but don't have the time to figure out how the server
>> works.

Since you say you don't necessarily want to use the rest of HTTP-CL,
here is an old message that might give you some useful alternatives.

============================================================
From: ······@george.rutgers.edu (Kuo-Chieh Ting)
Newsgroups: comp.lang.lisp
Subject: Answer: How to get a html content from net in lisp
Date: 20 Nov 1996 14:16:35 -0500
Organization: Rutgers University LCSR

Hi folks:

         Thanks for everybody, I got lots of response about how to use
lisp to grap a HTML file from the net.   This is a organized list.  if
someone has better idea, please post it to us. 


Kuo-Chieh Ting
······@paul.rutgers.edu
        

-------------------------------------------------------------------------
generic system shell 
 
From Leif Nixon (·····@softlab.se):
I'm using the Lynx browser for such things. You should have
no trouble finding it on e.g. Yahoo. It can be used in batch
mode to download webpages either in HTML or text
form.

Provided your lisp implementation permits you to call
an external program and return its result in a string, you
should have no problem to implement what you want.

I'm using scsh, a Scheme implementation intended for Unix
shell scripting and systems programming. In scsh you can
write get-page-from-url like this, provided you have Lynx
installed:

(define (get-page-from-url url)
  (run/string lynx -source ,url))

---------------------------------------------------------------------------
UNIX & PC:

From Lawrence Hunter  (······@nlm.nih.gov):
My advice would be to start with http://www.ics.uci.edu/WebSoft/libwww-perl,
and then call the perl script from within lisp.


From Judy Winn     (···@Franz.COM):
We have a socket package for Solaris 2, Sun OS and HP that makes this easy.
The sockets are available via ftp from ftp/franz/pub/socket, read me file is
socket.n.  There is also some source code example which you can find under
clients.

----------------------------------------------------------------------------
Machintosh:

from Shannon Spires     (·······@telespin.com):
This is pretty close to what you want, and it works in MCL:

(in-package :ccl)

(require :mactcp)

(defun get-http-string (server command)
  (let ((stream (open-tcp-stream server 80)))
    ;send the command
    (format stream  command)
    (write-char #\Newline stream)
    ;(write-char #\Newline stream) ; WebStar expects 2 Newlines
    (write-char #\Linefeed stream)
    (force-output stream)
    ;read the answer
    (let ((result nil))
      (push (read-char stream nil :end) result)
      (loop
        (cond ((ccl::stream-eofp stream)
               (return))
              (T
               (let ((char (read-char stream nil :end)))
                 (if (eq char :end)
                   (return)
                   (push char result))))
              ))
      (prog1
        (coerce (nreverse result) 'string)
        (close stream))
      )
    )
  )

(get-http-string "www.adobe.com" "GET /")

==========================
-- 
The reply address is faked to avoid spam.  Please reply to me by posting if necessary.
Support the anti-Spam amendment.  Join at http://www.cauce.org/
From: Jeremiah Thomas Isaacs
Subject: Re: Getting an HTML page using LISP
Date: 
Message-ID: <73feo9$aoi@hermes.acs.unt.edu>
Sean Brady <······@calpoly.edu> wrote:
: I am trying to get the HTTP-CL server running basically so that I can
: get pages off the web.  I don't need any of the server functionality.
: I was hoping someone could point me to some code which just creates a
: connection to the web and lets me get HTML pages.  I want to use this
: for my AI class but don't have the time to figure out how the server
: works.

: Thanks in advance.
: Sean Brady


someone already mentioned it, and its such a kludge, but i like it, and it
is using lynx -dump http://theurl > tempfile or something like that.

then again, i use eval ... (:

-- 
-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-/-
·······@jove.acs.unt.edu   talk.bizarre.rabbit
http://people.unt.edu/~jti0001
              __
             / /\
        .---/ /\ |
       / /o 0\  \|
      / /\ ^ /
     / / /   \_
     \ |/\\ //\}
      \|\ v_v /
         "" ""


Hi. Im not the signature virus. Why dont you copy me into your .sig?