[alicebot-archcomm] The saga continues: "Fetching Info from the Web"
Gary Robertson
alicebot-archcomm@list.alicebot.org
Fri, 01 Aug 2003 01:12:22 -0400
OK. I've poured over the W3C XML tutorial (again), read almost every
single word of the AIML specs, went through the W3C SOAP tutorial, and even
looked a little bit at WDDX.
I am quickly coming to the conclusion that there remains a need for a
simple fetch tool, because the overhead of setting up a SOAP approach is
so costly for simple items. But I also agree there is likely to be a need
for a more structured animal that takes on a SOAP functionality, with all
of the complexity that implies. I think both approaches could developed as
they serve different needs.
Here is what I have in mind for syntax for a simple fetch tool:
<template>
<fetch>
<url>
http://HomeScenes.com/GetPrice.cfm
</url>
<method>
post</method> <!-- Or optionally (method = get) -->
</method>
<outdata> <!-- standard form attribute-data pairs -->
<authoriziaton="secret">
<mlsid = "<get name='mlsidvar'>"> <!-- data can come from aiml vars
and bot class vars, also -->
</outdata>
<waitmsg>
O.K. - I will be happy to look that up for you. Just a moment
please... <!-- This msg is optional ... Not sure how
it could be displayed in a response html page, while waiting for the
fetch data ...although Cold Fusion has a 'flush'
command that forces text out to the browser that might work nicely -->
<waitmsg>
<timeout>
10 <!-- Intervals of seconds, the max amount of time to wait for
successful response,
with default set to 10 if not specified -->
</timeout>
<failmsg> <!-- presented only if fetch fails -->
My information sources are asleep on the job. Please ask for that info
again a little later. <!-- optional -->
</failmsg>
<indatatype>
xml <!-- or, indatatype can be 'html'-->
</indatatype>
<indata>
<"price"> <!-- aiml var names must match up with xml indata from vars
of same name, else they take on "" value. -->
<"address">
<"htmldoc"> <!-- alternate example of var name if indatatype is
'html'. Only one var permitted with this type.
</indata>
<successmsg> <!-- presented only if fetch is a success -->
The price for the property whose MLSID is <get name='mlsidvar'> and
whose address is <get name='address'>
is $<get name='price'> .
<!-- or if indatatype is "html , simply the contents of the html page -->
<get name="htmldoc">
</successmsg>
</fetch>
</template>