Exploiting http services with squeak

Timothy Mallon tmallon at worldnet.att.net
Fri Apr 13 20:40:42 UTC 2001


Markus Gälli wrote:
> 
> Hi,
> 
> I was quite impressed by Squeak using http-services like FreeTranslation.com
> or wordnet.
> 
> But how can one find out the parameters for a given http-service on the
> internet?
> E.g. for using FreeTranslation.com you have to know how to fill your
> post-message as follows:
> 
> FreeTranslation class >> translate: aString from: fromLang to: toLang
> (...)
> inputs _ Dictionary new.
> inputs at: 'SrcText' put: (Array with: aString).
> inputs at: 'Sequence' put: #('core').
> inputs at: 'Mode' put: #('html').
> inputs at: 'template' put: #('TextResult2.htm').
> inputs at: 'Language' put: (Array with: fromLang, '/', toLang).
> (...)
> 
> I want to connect to a chatterbot like
> http://www.hamill.co.uk/cgi-bin/hamill/mabel1/mabel.cgi
> 
> Do I have to ask the hosts of the site or is there a more "generic"
> solution?
> Any other ideas for http-services Squeak could legally "exploit" ?
> 
> Markus

Markus,

I have a prototype Squeak class whose instances can download definitions
(HTML or unHTMLed) from the Greek and Latin dictionaries at Perseus
(http://www.perseus.tufts.edu). Each instance keeps a cache of articles
that have been downloaded.

In this case, the main trick was to notice how the URL encodes the word
to lookup, then use an HTTP socket to GET the file for the URL the
client constructs.

The further problem is how to parse out the mass of HTML-formatted text
that comes back. That I decided against doing, settling for reading the
article as it comes. I suppose we can hope that information of this kind
will someday be suitably marked up. That will make the task of analyzing
and using it on the client side much easier.

TM





More information about the Squeak-dev mailing list