Amazon Products Feed: Display the Most Popular Items

Posted at 12:36 AM Gems, Instruction Manual, Toolbox

About apf_pop.cgi

MrRat's amazon_product_feeds.cgi script (APF) is a marvellously useful script. It's robust and nimble interface provides rich opportunities for exploitation. Here's a script most webmasters of APF sites will find useful. The apf_pop.cgi script searches your website's access log for specific kinds of APF calls that indicate a user clilcking on an item and grabs the Amazon ASIN's from them. The ASINs are counted and sorted, then one or more documents are constructed to display them. In addition to the data formatting templates available through APF, apf_pop adds an additional templating layer with its own variables. The type of document apf_pop can generate is virtually unlimited: HTML, SHTML, PHP, CGI, even output an APF template, if you like. As this implies, through apf_pop you can display data generated by APF in either dynamic or static documents. Continue reading "Amazon Products Feed: Display the Most Popular Items"

IFRAME and Amazon Product Feed:

Posted at 09:46 PM Gems, Instruction Manual, Notebook, Toolbox
How to display inline searches in your templates and pages

A Newbie Tutorial

On my HTML pages I figured out how to use SSI to display the results of amazon_product_feed searches on my web pages. However, Neither the SSI or PHP methods described in the documentation will work if placed within the templates. I've got this great sidebar in my page design but very few of the useful Amazon Product Feed variables are available at the page template level. What to do?

There are two HTML options <OBJECT> and <IFRAME>. These are fairly well supported on the more popular browsers, though OBJECT is the only one of the two specified in the HTML 4.0 standards. Nonetheless, I went with IFRAME for some of its more useful features.

Continue reading "IFRAME and Amazon Product Feed:"


Getting more from your affiliations.

Posted at 07:15 PM Toolbox

I have been providing links to on this site ( for a few years now and have been trying to figure out a way to expand the utility so folks from parts of the world outside the US could take advantage of the links.

Completely altruistic of me, of course. Has nothing to do with the fact that I don't earn a thing if I send users to the US site and they end up buying from (United Kingdom) or (Germany) or (Canada).
No way.

So the question has been, "How do I provide multiple links to the other Amazon sites without having to do a whole lot of work?"

A: amazon_products_feed.cgi, (AFP) a free CGI script from MrRat @

This is one of those no-brainer decisions. Installs in minutes and the generic interface works straight out of the box. Add some custom templating and you get something that looks like this! Well, actually, that took a fair bit of work, but it looked pretty similar to that on the very first go.

Using Amazon Web Services (AWS), the script natively supports US, UK and German affiliations, and with a little templating it's a cinch to add product links for Amazonia to your Canadian, French and Japanese affiliations as well.

I've not incorporated it into my blogspace yet, but I will, and will also update the macros I wrote to call MTAmazon. It may be possible to sidestep MTAmazon completely. I run multiple blogs which share templates, so there are some issues I need to work out regarding how to to get the macros to tell (AFP) which template to use, but it ain't rocket science.

In the meantime, I'll share a couple tidbits for cool AFP implementation tricks in the comments below. ('cause one of them is already marked-up for phpBB anyway.)