hasham2/amazon-awis — pull request #1 by Flushot (2012-01-16 04:34:33+00:00)
Title: Fixed broken AWIS request signing code, which was resulting in authentication errors being thrown. It appears the code was using an old signing method that eventually got deprecated on 5/25/11.

....

- Requests were using deprecated signatures. Updated signature method to version 2 as specified in AWIS documentation 2005-07-11: http://docs.amazonwebservices.com/AlexaWebInfoService/latest/index.html?CalculatingSignatures.html
- Included full response body in Amazon::RequestError thrown from self.get_info(), so that more information is returned rather than a generic HTTP status code (simple 400 and 403 errors don't tell me much.)
- Passing OpenSSL::Digest::Digest.new('sha1') to OpenSSL::HMAC.digest seemed to calculate incorrect signatures. Fixed this by passing the string 'sha1' instead.
- Replaced Time::now.utc.strftime(...) with Time.now.utc.iso8601, which does the same thing.

Fixed unit test:

- Unit test had a fixed rank of 3 for Yahoo, which failed since that's not the current rank. Changed the assertion to >0 instead.
- AWS_ACCESS_KEY_ID and AWS_SECRET_KEY are now retreived from environment variables, rather than having hardcoded values in the test script, since that would have some pretty bad security implications if keys were accidentally committed to a public Github repository :)