Skip to main content

Posts

Showing posts from June, 2009

Talk: Techniques for Building Third-party RESTful Web Services

I gave a talk today for Py Web SF called "Techniques for Building Third-party RESTful Web Services". Aside from covering a lot of material from the book "RESTful Web Services", I also covered a handful of tips and tricks that I discovered were necessary when creating a third-party RESTful Web Service meant for consumption by Web browsers. Here are the slides in OpenOffice.org format.

Python: Amazon Product Advertising API

If you use Amazon Associates Web Service, then you may have recently received an email explaining that they are renaming the service to the "Product Advertising API". They're also now requiring you to sign your requests. This was a problem for me. Previously, I was making requests without using an Amazon client library. It's pretty simple to use with just urllib2. However, the logic to sign requests is non-trivial.

I couldn't find any modern Python bindings for the Product Advertising API. However, I knew that boto was a popular client library for some of Amazon's other services like S3 and EC2. I figured the signing logic was probably the same. Even though boto doesn't support the Product Advertising API, I managed to get it to work.

Here's a simple proof of concept. You'll need your own access key, etc.:import time
import urllib

from boto.connection import AWSQueryConnection

AWS_ACCESS_KEY_ID = '...'
AWS_ASSOCIATE_TAG = '...'
A…

Vi: Pirates vs. Ninjas

"Killer coding ninja monkeys do exist."

Are you a pirate or a ninja?

Thanks to Andrew Hall for the shirt.