The Boo Version

by Miguel de Icaza

The same version of the C# program written in Boo:

	if len(argv) < 3:
		print "Usage is: associate-id token searchterm"
		return
	
	search = AmazonSearchService ()
	kr = KeywordRequest (keyword: argv [2], tag: argv [0],
		devtag: argv [1], mode:"books", page: "1", type: "lite")
	
	for detail in search.KeywordSearchRequest (kr).Details:
		print "Product: ${detail.ProductName}"
		if detail.Authors != null:
			print "Authors: {0}", string.Join (", ", detail.Authors)
	

To build:

	$ mcs -target:library AmazonSearchService.cs -r:System.Web.Services
	$ booc am.boo -r:AmazonSearchService.dll
	

To run:

	$ mono am.exe YourAssociateID YourToken YourQuery
	

Posted on 26 Nov 2005