views:

438

answers:

2

I am trying to get a specific music cd from Amazon using ruby-aaws.

il = ItemSearch.new( 'Music', { 'Artist' => artist_title,
                                'Title' => album_name } )
rg = ResponseGroup.new( 'Large' )

req = Request.new(AMAZON_KEY_ID, AMAZON_ASSOCIATES_ID, 'de')
resp = req.search( il, rg, 5)

But this fails. It only seems to work when I search for artist or title, not both at the same time. What am I making wrong? If I construct the url by hand, it works prefectly, but I really don't want to parse the xml manually myself.

A: 

I've had a bit of a look at the code of ruby-aaws. It looks like you should be able to set $DEBUG to true before calling any of the ruby-aaws methods/classes and see what URLs are being requested. If there are any discrepancies between your handcrafted URL and the one being generated by ruby-aaws, this might give you some clues.

floehopper
A: 

I just tried this use-case with the latest version of ruby-aaws and it works just fine.

I used the following for the ItemSearch (with the same code you posted initially):

il = ItemSearch.new( 'Music', { 'Artist'=>'The Smiths', 'Title'=>'Hatful' })

and got good results back as I would expect. Please try again and see if perhaps the latest ruby-aaws has ironed out a wrinkle which was stopping you.

Darren Hicks