Development
Authenticate REST requests to the Amazon Product Advertising API using Python
SowaCS Consulting’s Amazon Web Service Query Signer. Download the file called awsquerysigner_py.zip
As of August 15, 2009 Amazon required all API queries to have a special authentication signature. SowaCS Consulting has published a simple Python class (Python library?) that does the dirty work to sign your REST calls to the Amazon Product Advertising API. The code is on the website but they also offer a query signing service.
Back Story:
I finally got the gumption to attempt to tie in some AWS (Amazon Web Services) things into some of the websites I’m running because I want the affiliate advertising to blend in with my pages in a cleaner fashion. Unfortunately Amazon made it a lot harder for chumps like me to make API calls because of their newly enforced requirements that all requests be signed with a special hash signature. Steps involved to sign an Amazon REST request
- Take query params, re-order them by byte-value and make them UTF-8.
- url encode each key-value query parameter
- replace any “+” and “~” characters in the strings with url encodings
- add a timestamp
- Build a text string to prepare for hashing
- Encode signature using HMAC and SHA256
- Send request, and receive REST response.
This process sounds easy, but I couldn’t figure it out. I wrestled with Amazon’s Product Advertising API Documentation but the examples mostly uninformative. Thankfully, I came across a helpful post in the developer forums that points to SowaCS consulting. Naturally when looking at the code theirs is much cleaner, more flexible and it actually works. It’s not superb code but it IS way better than anything I would ever write. I really ought to go back to school…
Clean html for content pasted from Word into YUI rich text editor
I’ve been trying to come up with a good way to strip out crappy HTML pasted from MS Word into the Yahoo UI’s rich text editor. Thankfully I am not the only person with this problem and my procrastination pays off! Somebody else created a script to do it for me.
AntsCode has a nice tool to Strip Formatting on Paste using YUI Rich Text Editor
His solution is so simple I feel stupid for not thinking of it. He attaches a listener for the cut and paste command. When you paste into the Rich Text Editor it uses the standard YUI HTML stripper, then he goes in and strips out the unwanted word HTML formatting using a series of regular expressions. Clever.
PS3 Media server for Mac is a good free DLNA server
PS3 Media Server is a worthwhile free (open source, free of charge) DLNA server that works on Mac, PC, and Linux. I found it easier to setup than Fuppes which is another free DLNA server. This is not an apples to apples comparison. I’m just saying if you have the choice, I would try tinkering with PS3 Media Server before trying Fuppes to see if it fits your needs.
Both servers have transcoding capabilities but I have not tried transcoding with either package yet because my computers do not have enough power to do transcode large/long files.
PS3 Media Server
If you are looking for a free DLNA server to run on a GUI on box, PS3 Media Server is a decent option. I have become a recent fan. PS3 Media Server (blog) is a Java program available via Google Code (download). I installed it on my Mac and I like the results. It installs like a regular Mac program with a .dmg package. You start the PS3 MS application and the PS3 DLNA should see the server right away. I don’t think I had to change any port configurations or anything like that. The one thing that I DID change was to configure PS3 MS to only look for music and media in 2 specific folders on my Mac.
Fuppes
Fuppes is my DLNA server on a crappy Ubuntu computer I built. Fuppes works fine but it is disappointing in a few ways. First, it was difficult to setup on Ubuntu. I had to pull the development version from the fuppes SVN repository to get something that would work on my Ubuntu distro. Second, my PS3 can take HOURS after running the database update before newly added media files appear on the PS3. The advantage of Fuppes is that it works on a headless server and it has a relatively convenient web-based configuration interface.
