Looking back at
Sam Ruby's article,
Google's Genius, he mentions my favorite point in favor of SOAP/RPC:
Perhaps the most illumining part of Paul's essay is when he describes his optimized doSpellingSuggestion API.Ê In this case, he declares that XML is overkill for the job.Ê Unquestionably, omitting XML in some cases creates a tighter data stream.Ê It can also require custom marshallers and parsers to be written.Ê More tradeoffs to consider.
The second to last sentence is important. In my view, XML "scraping" is not much better than HTML "scraping". The Google API's were immediately usable in everything from Ruby to Python to AppleScript to Frontier/Radio, and more, with only a SOAP library needed - nothing specific to Google. The calls were Google specific, yes, but the client immediately understood the results of the call.
Even though it's a silly application, I would never have even attempted to write something like
HyprSwank, as mentioned in "AppleScript Studio, XML-RPC, and Zope", if I had to parse the results out of my data structure myself. I'm not sure what XML parsing libraries even exist for AppleScript, but I'm sure if they do (or were to) exist, it couldn't be any easier to use than:
tell application "http://euc.cx/" to set link_list to call xmlrpc {method name:"hyprSWNK", parameters:{}}Or in Python:
import xmlprclib, pprint
link_list = xmlrpclib.ServerProxy('http://euc.cx/').hyprSWNK()
pprint.pprint(link_list)
[{'sitename': 'mobileffe', 'link': 'http://www.mobileffe.com/'},
{'sitename': 'Prada', 'link': 'http://www.prada.com/'},
{'sitename': 'ACFny', 'link': 'http://www.acfny.org/'},
{'link': 'http://www.peopleusedtodream',
'sitename': 'People Used To Dream About The Future'},
{'sitename': 'David Lynch', 'link': 'http://www.davidlynch.com/'},
{'sitename': '.tiln', 'link': 'http://tiln.net/'},
{'link': 'http://www.timecube.com/',
'sitename': 'educated people are stupid cowards'},
{'link': 'http://www.antigirl.com/',
'sitename': 'absolut antigirl !(absolut cybele)'},
{'sitename': 'no ~ type', 'link': 'http://www.notype.com/'},
{'sitename': 'meta.am +=', 'link': 'http://meta.am/'},
{'sitename': 'fals.ch', 'link': 'http://fals.ch/'},
{'sitename': 'infotron', 'link': 'http://infotron.web.fm'},
{'link': 'http://www.m9ndfukc.org/korporat/',
'sitename': 'aaaaaaa n t i o r p;uss'},
{'sitename': 'nato0+55+3d', 'link': 'http://www.eusocial.org/'},
{'link': 'http://www.angelfire.com/electronic/campmsp/',
'sitename': 'themoonstealingproject'},
{'link': 'http://artists.mp3s.com/artists/42/musiquemotpol.html',
'sitename': 'musique:motpol @ mp3.com'},
{'link': 'http://www.helmutlang.com/',
'sitename': 'finest cotton armbags since 1997 (HL)'},
{'sitename': 'One Bit Louder', 'link': 'http://mi.cz/obl/'},
{'sitename': 'purple', 'link': 'http://purple.fr/'},
{'sitename': 'OFRPublications', 'link': 'http://www.ofrpublications.com/'}]
While I could have written my own parser, written my own format, or spent time researching common XML formats and then scouring the web for an already written parser for my language or sitting down with a copy of "XML and Python", I chose not to.
For as much as I rag sometimes on some of XML-RPC's shortfalls, it's much better than doing all of that! It gives one common format for a common internet use, and has spread around to many languages. If I had to write my parser, or wait for someone to write one, or deal with DOM navigation, in order to deal with GoogleML, I'd be much less curious about "hmm, what can I write today to take advantage of that?".
A nice thing that Bobo got right from day one was to implement and handle marshalling of incoming HTTP requests in such a way that my code never has to go through a "is it a list? is it a string? is it a string I can convert to a list?" somersault again. Or at least, not often.