<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/6c91b37d183b7f7b53c4592b0f4eada4"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-11T09:39:57"
  subject="Re: [Caml-list] access to the internet"
  prev="2003/11/4072f8a022bcb9a3074d03fa6da4801f"
  next="2003/11/a642417b7560adc7bbe5629a8c00af3a"
  prev-in-thread="2003/11/4072f8a022bcb9a3074d03fa6da4801f"
  next-in-thread="2003/11/a642417b7560adc7bbe5629a8c00af3a"
  prev-thread="2003/11/c950cf7764ddb8e256d4f95c9c48ff10"
  next-thread="2003/11/6c7eeee8f6105aa3a5ef377169475e2c"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] access to the internet">
<msg 
  url="2003/11/aec9ff3da1a5c8e937e938441c778914"
  from="Pierre LAFFITTE &lt;pierre.laffitte@w...&gt;"
  author="Pierre LAFFITTE"
  date="2003-11-10T17:56:27"
  subject="[Caml-list] access to the internet">
<msg 
  url="2003/11/4072f8a022bcb9a3074d03fa6da4801f"
  from="Sven Luther &lt;sven.luther@w...&gt;"
  author="Sven Luther"
  date="2003-11-11T09:21:27"
  subject="Re: [Caml-list] access to the internet">
<msg 
  url="2003/11/6c91b37d183b7f7b53c4592b0f4eada4"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2003-11-11T09:39:57"
  subject="Re: [Caml-list] access to the internet">
<msg 
  url="2003/11/a642417b7560adc7bbe5629a8c00af3a"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-11-11T10:20:49"
  subject="Re: [Caml-list] access to the internet">
<msg 
  url="2003/11/fd3a18e2126bc42ed73c26461de1220f"
  from="Christophe TROESTLER &lt;debian00@t...&gt;"
  author="Christophe TROESTLER"
  date="2003-11-11T18:11:44"
  subject="Re: [Caml-list] access to the internet">
</msg>
</msg>
<msg 
  url="2003/11/72e6270c997e9f25054806409b1e1762"
  from="Eric C. Cooper &lt;ecc@c...&gt;"
  author="Eric C. Cooper"
  date="2003-11-11T14:20:12"
  subject="Re: [Caml-list] access to the internet">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
On Tue, Nov 11, 2003 at 10:21:26AM +0100, Sven Luther wrote:
&gt; On Mon, Nov 10, 2003 at 06:56:25PM +0100, Pierre LAFFITTE wrote:
&gt; &gt; Is it possible from a caml program, to give an internet adress, to get the result in a file or in a set of character to analyse it.
&gt; 
&gt; I have been searching for exactly that some time ago, but i think it is
&gt; not possible. Your best guess currently is to call the external wget
&gt; program, save it to a temporary file, and then read it in.
&gt; 
&gt; I agree that a full url-reading module would be a good addition to the
&gt; ocaml library though, java has it for example.

Actually there are two (at least) ways of doing this:

http://sourceforge.net/projects/ocurl/

which is an OCaml wrapper around the Curl library.

Or, you could use some Perl-fu with:

http://www.merjis.com/developers/perl4caml/

which includes a wrapper around the Perl LWP and HTML::TreeBuilder
libraries, so you could not only download the page, but also parse it
into an HTML tree (the HTML::TreeBuilder parser is about the best
parser ever written for parsing fuzzy, incorrect HTML, and there's
really no way you would want reinvent this in OCaml).

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
MONOLITH is an advanced framework for writing web applications in C, easier
than using Perl &amp; Java, much faster and smaller, reusable widget-based arch,
database-backed, discussion, chat, calendaring:
http://www.annexia.org/freeware/monolith/

-------------------
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

</contents>

</message>

