Rescuscitating AMM with Amazon Web Service signed requests

A few days ago Amazon added a requirement to their AWS that all requests to the service be signed, lest they be rejected. I’ve been using Sozu’s excellent Amazon Media Manager plugin for a while now to manage the currently reading list on this blog. It’s been a great way to keep track of exactly what I have read (avoiding the need to, like, remember), as well as masking my illiteracy by pasting a giant list of what is commonly known as airport trash.

Unfortunately, this is one plugin that hasn’t been updated in quite a while (after all, if ain’t broke…), so it broke. Being the sort of developer that’s quite happy to pick up a block of php and hack it until it works, I stumbled across this blog entitled ‘Amazon® AWS HMAC signed request using PHP‘, which has a function to download.

So to fix AMM:

1. Download that file, and copy the contents into the bottom of amm_parser.php.

2. In the same file (amm_parser.php), replace your _setUrl function with this one:

[codesyntax lang=”php”]function &_setUrl() {
//Build URL from base URL and other required parameters
switch ($this->_locale) {

case ‘uk’:
$region = ‘’;
case ‘de’:
$region .= ‘de’;
case ‘jp’:
$region .= ‘’;
case ‘fr’:
$region .= ‘fr’;
case ‘ca’:
$region .= ‘ca’;
case ‘us’:

$region = ‘com’;

$public_key = “< < Your Access Key ID >>”;
$private_key = “< < Your Secret Access Key >>”;
$url = aws_signed_request($region, array(
“Operation”=> “ItemSearch”,
“Keywords” => $this->_parameters[Keywords],
“SearchIndex” => $this->_parameters[SearchIndex],
“AssociateTag” => urlencode($this->_associate_tag)),
$public_key, $private_key);
return $url;

3. Oddly enough, this new method requires a private secret key which Amazon recommends to not give to anyone. So I’m not going to post mine here, even though it’s required for the plugin to work. So before I ponder that particular nugget of madness, you’ll need to sign up for an AWS developer account, and find your own keys via the Access Identifiers page. These need to be added into the function above.

That should be enough to get you back up and running again, although selfishly I’ve only really tested it for my needs alone. So please let me know if it works, or fails miserably.

For all the legal bits, I’m not at all affiliated with Amazon or Sozu – so please use at your own risk 🙂

Tags: , , , , , ,

Leave a Reply?