From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA22923; Tue, 3 Sep 2002 14:10:06 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA22966 for ; Tue, 3 Sep 2002 14:10:06 +0200 (MET DST) Received: from hirsch.in-berlin.de (hirsch.in-berlin.de [192.109.42.6]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g83CA5P20040 for ; Tue, 3 Sep 2002 14:10:05 +0200 (MET DST) Received: from hirsch.in-berlin.de (localhost [127.0.0.1]) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with ESMTP id g83CA40D015545 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT); Tue, 3 Sep 2002 14:10:04 +0200 Received: (from uucp@localhost) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with UUCP id g83CA4BD015543; Tue, 3 Sep 2002 14:10:04 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: caml-list@inria.fr Received: from localhost (oliver@localhost) by first.in-berlin.de (8.7.6/8.7.3) with SMTP id NAA07991; Tue, 3 Sep 2002 13:21:32 +0200 Date: Tue, 3 Sep 2002 13:21:31 +0200 (MET DST) From: Oliver Bandel To: Gerd Stolpmann cc: Caml list Subject: Re: [Caml-list] Ocaml-Weblib? In-Reply-To: <20020903004410.GG818@ice.gerd-stolpmann.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 3 Sep 2002, Gerd Stolpmann wrote: > > Am 2002.09.03 01:24 schrieb(en) Oliver Bandel: > > On Tue, 3 Sep 2002, Gerd Stolpmann wrote: [...] > HTML parsing can be done with Nethtml. Simple example: > > Nethtml.parse > (new Netchannels.input_string "......") > > Returns something like > > [ Element("html",[], [ Element("head",[], [ ... ]); > Element("body",[], [ ... ]) ) ] > > just try it in the toploop. [...] OK, done. Is good... very good. Yields expected results similar to the Perl-Libs for such work; but it's soooo much better here, because it's cleaner ( typesafety and clearer structure than the Perl-stuff :) ). So, this is, what I have looked for. :) Are there "opposite" tools, to out back the datastructure, which will get here from html-parsing back into a html-file? I think about reading a html-file, throwing out unnecessary contents, adding interesting stuff, re-layouting the page and create new pages, better for viewing as output. (Often webpages are messy (called "good designed";-)) and I only need two or three parts of it. Creating a pagelaout, which matches my needs is intended here.) Can this be done by the cgi-module? Or is it part of the nethtml-lib? [...] > As far as I know there is no ready-to-use NNTP client. There are important > components for an NNTP client, though. For example, there are parsers for > messages in email format, and there is the working implementation for the > POP protocol that has some similarities. OK, if I can rely on the ocamlnet's sub-libraries, then I may write such a client based on it. [...] > There is another object involved (input_stream) that has no effect if you > read only from a string, but that allows you to read the header from > non-seekable files (e.g. pipelines or sockets). But this is definitely > a feature for experts. Well, I have done socket-programming .... in C. :) [...] > See the sources in netpop.ml for an example how to write a "telnet-style" > client. Note that netpop.ml does not use sockets, it expects that the > user of this module passes channels that are already connected sockets. Hmhhh... how can be sockets read like channels? Sockets must be handled unbuffered... Unix.read and such functions... hmhhh is this done by Stream-module or similar things? (Or could it be done in this way?) [...] > I hope this short introduction gives you the right impression of > the library. Yes. It's powerful (and wonderful:)). With each more of impression of Ocaml's features (e.g. module system) and such libraries, I see, that my interest in perl and other languages fades away.... Ciao, Oliver ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners