Amazon Products Feed FAQ




This script is so configurable it can get very confusing; just remember that these are all options. You can just insert your affiliate code, plop this script on your server, and it will run. If you decide to configure it; take it slowly, change one thing at a time, and study the examples. If all else fails check out the Support Forum.



  • How do I alter the results of the script?
  • How do I customize the HTML output of the script?
  • How do I use options in the templates to further customize the HTML output?
  • How do I change the language?
  • How do I limit the number of results?
  • How do I display more results?
  • How do I display a specific category of bestsellers?
  • What options are available for searching?
  • What other options are there?
  • What about international versions?
  • Where is the best place to get support and/or discuss your scripts?



    How do I alter the results of the script?




    How do I customize the HTML output of the script?

    Template files. Simple text files containing the HTML and variables you want my script to use to match your site's look and feel. these are used in sets, so $templates_number = 1 specifies the first page template, the first products template, the first item template, etc. And you can use as many sets as you would like so that 1 script can display different items in different ways. Please study the example template files for the proper use of the variables.

    @page_templates = ("page.template", "/you/can/even/supply/full/path/to_another.template");
    @products_templates = ("products.template", "../or/a/relative/path/to_another_product.template");
    @item_templates = ("item.template", "item_2.template");
    @larger_image_templates = ("image.template", "image.template");
    Additional Templates:
    You specify which set of templates to use in the URL with input_templates. You can even specify one set of templates to display the page and with input_link_templates another set to be used with any link that is clicked on that page.

    To demonstrate look at this page No Options Here; then look at my gaming page half way down the right column Options Used Here and you'll see the bestselling games from Amazon. These are produced with the same script. On the gaming page I just called the script with SSI like this:
    <!--#include virtual="/cgi-bin/amazon_products_feed.cgi?input_id=471280&input_mode=videogames&input_templates=2&input_link_templates=1" -->



    How do I use options in the templates to further customize the HTML output?

    The options and the HTML they effect are enclosed in a special comment tag.
    <!--apf &option1=value&option2=value! HTML here !-->
    Notice the exclamation points, they separate the different parts of the command. <!--apf tells the script that options will follow. All options must be proceeded by an & to separate them and the last option is indicated by following it with an !. Anything following that ! through !--> is considered the HTML you want to control. If the option doesn't contain HTML, like for including a text file, the exclamation points still need to be there.
    These options are demonstrated with this Web Services search. Note the site links at the bottom are from an included file and there are now TABLE rows!



    How do I change the language?

    Languages work like the templates. Simple text files of all the variables that contain the text the script displays that does not come from Amazon. If you wish to create your own language file please use the sample English file as a starting point and be sure and send me a copy so we can share it with others. I would like to provide as many different languages as possible.

    @language_templates = ("apf_missing.language", "apf_dutch.language");
    You specify which language to use in the URL with input_language.

    To display multiple languages in HTML there is a special charset (character set) called Unicode. This is the format that Amazon sends their results in and so it is what my script uses. To use accented characters in the language files you must use Unicode entities. Entities are just &#(a number);. I wrote a script to display the characters and show the entity for each so you can use them in your language file - Unicode Generator.



    How do I limit the number of results?

    Just change the number in the line
    $max_results = 10;
    to the maximum number of results you want on the page.



    How do I display more results?

    Amazon usually only returns 10 products per page. But you can add variables to your page.template that will display links to more results.

    %%see_next%% will display a link to the next page of products and %%see_prev%% will display a link to the previous page. %%see_total%% will display the total number of pages and %%see_index%% will display a "Google" type index of pages.



    How do I display a specific category of bestsellers?

    input_id - this is the category number that you wish to display the bestsellers of.

    You can find these id numbers at Amazon's Browse-based Bestsellers Links. On that page you see a list of modes, be sure you set the appropriate mode in the URL when you use input_id.

    Let's say I want to display the bestselling books on Birdwatching. I first decide my mode, Books, so input_mode=books. Now I click on Books, Outdoors & Nature, and my final category Birdwatching. After you have clicked on the final category look in the URL of the page you are on and find the "node". In this case I see that node=16386, use this number for input_id. To display the bestselling books on Birdwatching I would use the URL
    /cgi-bin/amazon_products_feed.cgi?input_mode=books&input_id=16386.

    The input_id numbers that the script already knows and uses for browsing are listed here.



    What options are available for searching?

    Different searches are specified using the input_search_type option in the URL and the variables page lists the many different types of searches. All of the searches are displayed on one page using the AllSearches input_search_type. If you would like to place a search box on any other page of your site just pull up the AllSearches page and view the source to copy the HTML for the search you want.



    What other options are there?

    If you really want to know everything you can do with the script read the Amazon Products Feed Variables page.



    What about international versions?

    Both Amazon.com and Amazon.co.uk are supported. You can select which language to use in the URL by using &input_locale=us or &input_locale=uk. I plan to support CA when a feed is available and maybe other sites if the language barrier can be overcome.



    Where is the best place to get support and/or discuss your scripts?

    You can discuss my scripts at MrRat's Scripts Support Forum
    You can subscribe to our Scripts Announce list to be notified when changes are made to my scripts.
    The latest version of this script can always be found at MrRat.com