BYTE.com > Features > 1999 > August
Web components 101
By Jon Udell
August 30, 1999
(Exploring XML-RPC
: Page 2 of 5 )
Web sites that support CGI-based services implicitly define what I
call Web APIs . For example, part of Alta Vista's Web API is a
method that might be formalized as:
getReferenceCount ( sitename )
My
href="http://img.byte.com/byte/features/1999/03/19990308_udell.perl">mindshare-measuring
script invokes what might be called a Web RPC on the Alta Vista site in order to count references to a target
site. You don't have to write scripts to use Web RPCs; we do this
trivially when we save bookmarks to CGI-based services (e.g., a
bookmark to an Alta Vista query, not its result). But when you
automate the use of these RPCs, you can create new and interesting
applications.
To do that involves a process that I call reverse-engineering
the Web API. In the case of Yahoo, the relevant API is just its
tree-structured URL namespace (e.g.
/Computers_and_ Internet/Software/Operating_Systems/Windows/).
In the case of Alta Vista, it's a CGI-style URL built on this pattern:
http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=link%3A{SITENAME}+-url%3A{DOMAIN}
Here {SITENAME} and {DOMAIN} are, effectively,
function-call arguments; the script plugs in real values for these
arguments and then "calls" the Alta Vista "component." Alta Vista's
Web API is easy to discover because it uses the HTTP get method; that
means the URL you need to parameterize is left sitting in the
browser's location (Netscape) or address (Microsoft) field. When a
site uses the HTTP Previous page Page 2 of 5 Next page
BYTE.com > Features > 1999 > August
|