#!/usr/bin/perl
#####
# APF Version 3.030823b-BMP2.0
# 3.030823b Originally coded by MrRat - http://www.mrrat.com, GPL Licensed
# Make MrRat donation at http://s1.amazon.com/exec/varzea/pay/T3M26803DZOCMK
# BMP version Mods by Justin of World Famous Comics - http://www.worldfamouscomics.com
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at:
# http://www.opensource.org/licenses/gpl-license.html
#####
#use strict;
#use CGI::Carp qw/fatalsToBrowser/;
#use warnings;
$SIG{ALRM} = sub { die "timeout\n" };
alarm(90); # seconds until timeout
my (%FORM, %MY_variables, %associate_ids);
$scripturl = "/"; # better control of script_name
$title_length = 5; # word length for %%simple_title%% and %%simple_title_url%%
$randdelimitor = '
'; # delimitor for elements in random files
# code for %%allbutcart%%
#$MY_variables{allbutcart} = qq[
];
$MY_variables{allbutcart} = qq[
];
$MY_variables{onlycart} = "";
# Check the perl line at the top and make sure it points to the proper location.
# Place this cgi in your cgi-bin directory and make it executable (chmod 755).
# Put your Amazon.com affiliate id below.
$associate_ids{us} = [ "webhostingsoluti" ];
# basic options:
# set the locale: "us", "uk", "de"
$FORM{locale} = "us";
# If you are going to use locales othen than "us" you need to put those associate ids below.
$associate_ids{uk} = [ "mrratcom-21" ];
$associate_ids{de} = [ "ari04" ];
# show search options link?
my $show_search_options = "no";
#
# advanced options:
# before messing with these you'll want to read the FAQ at http://www.mrrat.com/aws/amazon-products-feed-faq.html
# list of featured products for random selection with apf_featured_product
my @featured_products = ("B0000A5R5M", "B0000A5R58", "B0000D8DKT", "B00022HXOW", "B00022HY7S", "B00022ADX0", "B0000U9H40", "B0000U98MQ", "B0000CEUM7", "B00011PYDQ", "B0000CEUFE", "B00005V5YO", "B00005NK3A", "B0000899ZB", "B0000899ZC", "B00008DCYE", "B000067V08", "B00008DCY0", "B0000AKACN");
# cache settings - file location and number of requests to cache
my $use_cache = "yes";
my $cache_file = "apf_xml_cache";
my $cache_max_size = "1000";
# length of reviews in %%my_shortened_comments%% and %%first_review_shortened_comment%%
my $review_length = 275;
# templates are comma separated lists, and if blank or non-existent will use embedded HTML
my @page_templates = ("bmp_page.html", "bmp_page.html", "", "javascript_page_4.html");
my @products_templates = ("bmp_products.html", "bmp_products.html");
my @item_templates = ("bmp_item.html", "bmp_item.html");
my @larger_image_templates = ("bmp_larger_image.html", "bmp_larger_image.html");
my @sellersearch_templates = ("bmp_sellersearch.html", "bmp_sellersearch.html");
my @sellerprofile_templates = ("bmp_sellerprofile.html", "bmp_sellerprofile.html");
my @thirdparty_products_templates = ("bmp_thirdpartyproducts.html", "bmp_thirdpartyproducts.html");
my @browse_menu_templates = ("bmp_browsemenu.html", "bmp_browsemenu.html");
my @nav_menu_templates = ("bmp_navmenu.html", "bmp_navmenu.html");
my @blended_templates = ("bmp_blended.html", "bmp_blended.html");
my @featured_product_templates = ("bmp_featuredproduct.html", "bmp_featuredproduct.html");
my @shopping_cart_templates = ("bmp_shoppingcart.html", "bmp_shoppingcart.html", "", "javascript_cart_4.html");
my @customer_reviews_templates = ("bmp_item.html", "bmp_item.html");
my @language_templates = ();
my @homepage_templates = ("bmp_homepage.html", "bmp_homepage.html");
my @featured_home_templates = ("bmp_featuredhome.html", "bmp_featuredhome.html");
# location of optional language files - comma separated, if blank or non-existent will use embedded English
sub load_language {
my $temp_input = shift;
my @temp_array = @$temp_input;
# start default language
if ($FORM{locale} eq "uk") {
$amazon_site = "Amazon.co.uk";
} elsif ($FORM{locale} eq "de") {
$amazon_site = "Amazon.de";
} else {
$amazon_site = "Amazon.com";
}
$language_text{header_text1} = "The Best Source for Apple Mac Products";
$language_text{header_text2} = "Items";
$language_text{header_text3} = "Some Picks";
$language_text{header_text4} = "Selections";
$language_text{header_text5} = "Categories";
$language_text{my_artists_text1} = "By:";
$language_text{my_artists_text2} = "Starring:";
$language_text{my_artists_text3} = "From:";
$language_text{my_artists_text4} = "Directed by:";
$language_text{my_prices_text1} = "List Price:";
$language_text{my_prices_text2} = "Your Price:"; # $amazon_site . "'s Price:"
$language_text{my_prices_text3} = "Save:";
$language_text{my_prices_text4} = "prices subject to change";
$language_text{my_prices_text5} = "not available"; # "price not available"
$language_text{button_text1} = "Buy thru Amazon"; # . $amazon_site
$language_text{button_text2} = "Add to " . $amazon_site . " Wishlist";
$language_text{button_text3} = "Add to " . $amazon_site . " Wedding Registry";
$language_text{button_text4} = "Search";
$language_text{button_text5} = "Add to " . $amazon_site . " Baby Registry";
$language_text{button_text6} = "Sort by";
$language_text{button_text7} = "Change Quantities";
$language_text{button_text8} = "Delete";
$language_text{button_text9} = "Empty Shopping Cart";
$language_text{button_text10} = "Add to Shopping Cart";
$language_text{button_text11} = "See More Details";
$language_text{my_marketplace1} = ""; #Prices:
$language_text{my_marketplace2} = "Used Price:";
$language_text{my_marketplace3} = "Collectible:";
$language_text{my_marketplace4} = "3rd Party New:";
$language_text{my_marketplace5} = "Refurbished:";
$language_text{my_features_text1} = "Features:";
$language_text{my_similar_products_text1} = "Similar Items:";
$language_text{my_accessories_text1} = "Accessories:";
$language_text{my_product_description} = "Item Description";
$language_text{my_comments_text1} = "Rating:";
$language_text{my_comments_text2} = "Read More";
$language_text{my_descriptors_text1} = "Release Date:";
$language_text{my_descriptors_text2} = "Theatrical Date:";
$language_text{my_descriptors_text3} = "Format:";
$language_text{my_descriptors_text4} = "Number of Media:";
$language_text{my_descriptors_text5} = "MPAA Rating:";
$language_text{my_descriptors_text6} = "Platform:";
$language_text{my_descriptors_text7} = "ESRB Rating:";
$language_text{my_descriptors_text8} = "Age Group:";
$language_text{my_descriptors_text9} = "Sales Rank:";
$language_text{my_descriptors_text10} = "Encoding:";
$language_text{my_descriptors_text11} = "
Tracks:";
$language_text{my_descriptors_text12} = "Reading Level:";
$language_text{my_descriptors_text13} = "Company:";
$language_text{my_browse_list_text1} = "Browse:";
$language_text{see_text1} = "Next >";
$language_text{see_text2} = "< Previous";
$language_text{see_text3} = "Back";
$language_text{see_text4} = "page";
$language_text{see_text5} = "of";
$language_text{see_text6} = "More Similar Items...";
$language_text{see_text7} = "Similar Items";
$language_text{association_text1} = "In association with " . $amazon_site;
$language_text{availability_text1} = "Availability:";
$language_text{availability_text2} = "Not currently available."; # "Not currently available for purchase."
$language_text{see_larger_image_text1} = "See Larger Image";
$language_text{customer_reviews_text1} = "Customer Reviews";
$language_text{average_rating_text1} = "Average Rating:";
$language_text{average_rating_text2} = "none";
$language_text{similar_text1} = "Featured Listmania! List";
$language_text{thirdparty_text1} = "Seller:";
$language_text{thirdparty_text2} = "Condition:";
$language_text{thirdparty_text3} = "Condition Type:";
$language_text{thirdparty_text4} = "From:";
$language_text{thirdparty_text5} = "Comments:";
$language_text{thirdparty_text6} = "Quantity:";
$language_text{thirdparty_text7} = "Offering Type:";
$language_text{thirdparty_text8} = "End Date:";
$language_text{thirdparty_text9} = "Total Feedback:";
$language_text{thirdparty_text10} = "Cancelled Auctions:";
$language_text{thirdparty_text11} = "Date:";
$language_text{cart_text1} = "Shopping Cart";
$language_text{cart_text2} = "
There is nothing in your shopping cart.
";
$language_text{cart_text3} = "
"; # View Cart or Checkout
$language_text{cart_text4} = "Include in Cart:";
$language_text{javacart_display} = "&templates=4";
$language_text{locale_text1} = "International Store:";
$language_text{locale_text2} = "USA";
$language_text{locale_text3} = "United Kingdom";
$language_text{locale_text4} = "Germany";
$language_text{locale_text5} = "Japan";
$language_text{sort_text1} = "Featured";
$language_text{sort_text2} = "Top Selling";
$language_text{sort_text3} = "Average Rating";
$language_text{sort_text4} = "Price (Low-High)";
$language_text{sort_text5} = "Price (High-Low)";
$language_text{sort_text6} = "Release Date";
$language_text{sort_text7} = "[ A - Z ]";
$language_text{sort_text8} = "[ Z - A ]";
$language_text{sort_text9} = "Company (A-Z)";
$language_text{sort_text10} = "Company (Z-A)";
$language_text{sort_text11} = "Artist Name";
$language_text{sort_text12} = "Original Release Date";
$language_text{searchbox_text1} = "All items";
$language_text{searchbox_text2} = "This category only";
$language_text{searchbox_text2_2} = "This category";
$language_text{searchbox_text3} = "Search Options";
$language_text{searchbox_text4} = "Search by";
$language_text{searchbox_text5} = "Item";
$language_text{searchbox_text6} = "Actor/Actress";
$language_text{searchbox_text7} = "Search String";
$language_text{searchbox_text8} = "Sort by";
$language_text{searchbox_text9} = "Artist/Musician";
$language_text{searchbox_text10} = "Author";
$language_text{searchbox_text11} = "BrowseNode";
$language_text{searchbox_text12} = "Browse Id Number";
$language_text{searchbox_text13} = "Product Mode";
$language_text{searchbox_text14} = "Price Range";
$language_text{searchbox_text15} = "Director";
$language_text{searchbox_text16} = "Listmania";
$language_text{searchbox_text17} = "Company";
$language_text{searchbox_text18} = "Power Search";
$language_text{searchbox_text19} = "Similar Products";
$language_text{searchbox_text20} = "third-party ASIN";
$language_text{searchbox_text21} = "Third-party exchange ID";
$language_text{searchbox_text22} = "Third-party Seller ID";
$language_text{searchbox_text23} = "UPC";
$language_text{searchbox_text24} = "WishList id";
# end default language
my $temp_num = $FORM{language} - 1;
if ($FORM{language} and -e $temp_array[$temp_num]) {
require $temp_array[$temp_num];
} elsif ($FORM{locale} eq "de" and -e "apf_de.language") {
require "apf_de.language";
}
}
# setup initial variables
my (%chat_modes, %lookup_store, %store_to_browse, %all_store_to_browse, %all_catalog_to_mode, %catalog_to_mode, %sort_hash, %sort_hash_by_mode, %offering_type );
my ($debug, $debug_state, %AWS_variables, $session, %template_html, $nav_menu_type, $html);
my ($url_mode, $url_options, $see_url_options, %lookup_browse_id, $query, $my_marketplace_text, $sellerprofile_max, $amazon_server, $money_symbol, $details_max, $menu_length, $sort_mode );
# HACK BELOW - modified for better control of script_name
$MY_variables{script_name} = $scripturl;
# $MY_variables{script_name} = $ENV{SCRIPT_NAME};
if ($MY_variables{script_name} =~ /test.cgi/) { $debug_state = "on"; $cache_file = "apf_xml_cache.test"; } elsif (-e "ratlog.cgi") { require "ratlog.cgi"; }
$FORM{page_num} = 1;
$FORM{sort_type} = "+salesrank";
$FORM{max_results} = 50;
get_url_input();
# HACK BELOW clear %%allbutcart%% variable if a cart action
if ($FORM{cart_action}) {$MY_variables{allbutcart} = $MY_variables{onlycart};}
if ($FORM{search_type} eq "FeaturedProducts") { $FORM{item_id} = join(",", @featured_products); }
if ($FORM{mode} =~ /node:/) { $FORM{mode} =~ s/node:([^:]+):(.*)/$1/; $FORM{node} = $2; }
if (!$FORM{link_templates}) { $FORM{link_templates} = $FORM{templates}; }
$debug .= qq[mode = $FORM{mode} | id = $FORM{node} | search = $FORM{input_string}\n];
load_language(\@language_templates);
initialize_hashes();
load_templates();
START_PROCESSING_LABEL:
calculate_initial_variables();
sub initialize_hashes {
# my %us_store_to_browse = ( "Baby" => "baby", "Books" => "books", "Classical Music" => "classical", "DVD" => "dvd", "Electronics" => "electronics", "Kitchen & Housewares" => "kitchen", "Magazines" => "magazines", "Outdoor Living" => "garden", "Popular Music" => "music", "Computers" => "pc_hardware", "Camera & Photo" => "photo", "Software" => "software", "Tools & Hardware" => "universal", "Toys & Games" => "toys", "Video" => "vhs", "Computer & Video Games" => "videogames" );
# HACK - customized browse/mode selections
my %us_store_to_browse = ( "Books" => "books", "Electronics" => "electronics", "Hardware" => "pc_hardware", "Software" => "software", "Video Games" => "videogames" );
# my %us_store_to_browse = ( "Books" => "node:books:5", "Electronics" => "node:electronics:290609", "Hardware" => "node:pc_hardware:565124", "Software" => "node:software:229643", "Video Games" => "node:videogames:229647" );
my %uk_store_to_browse = ( "Books" => "books_uk", "Popular Music" => "music", "Classical Music" => "classical", "DVD" => "dvd_uk", "Video" => "vhs_uk", "Electronics" => "electronics_uk", "Kitchen & Housewares" => "kitchen_uk", "Software" => "software_uk", "Computer & Video Games" => "video_games_uk", "Toys & Games" => "toys_uk" );
my %de_store_to_browse = ( "Bücher" => "books_de", "Musik" => "pop_music_de", "Musik (Klassische)" => "classical_de", "DVD" => "dvd_de", "Video" => "vhs_de", "Elektronik & Foto" => "ce_de", "Küche & Haushalt" => "kitchen_de", "Software" => "software_de", "Computer & Video-Spiele" => "video_games_de", "Zeitschriften" => "magazines_de", "Englische Bücher" => "books_de_intl_us");
%all_store_to_browse = ( "us" => \%us_store_to_browse, "uk" => \%uk_store_to_browse, "de" => \%de_store_to_browse );
# my %us_catalog_to_mode = ( "Apparel" => "apparel", "Baby Product" => "baby", "Book" => "books", "DVD" => "dvd", "Electronics" => "electronics", "Home Improvement" => "universal", "Kitchen" => "kitchen", "Lawn & Patio" => "garden", "Magazine" => "magazines", "Magazines" => "magazines", "Music" => "music", "Personal Computer" => "pc_hardware", "Software" => "software", "Toy" => "toys", "Video" => "vhs", "Video Games" => "videogames", "Sporting Goods" => "sporting", "Sports" => "sporting" );
my %us_catalog_to_mode = ( "Apparel" => "electronics", "Baby Product" => "electronics", "Book" => "books", "DVD" => "dvd", "Electronics" => "electronics", "Home Improvement" => "electronics", "Kitchen" => "electronics", "Lawn & Patio" => "electronics", "Magazine" => "books", "Magazines" => "books", "Music" => "music", "Personal Computer" => "pc_hardware", "Software" => "software", "Toy" => "electronics", "Video" => "vhs", "Video Games" => "videogames", "Sporting Goods" => "electronics", "Sports" => "electronics", "Ebook" => "books", "Drugstore" => "electronics", "Home" => "electronics" );
my %uk_catalog_to_mode = ( "Book" => "books_uk", "Music" => "music", "DVD" => "dvd_uk", "Video" => "vhs_uk", "Electronics" => "electronics_uk", "Kitchen" => "kitchen_uk", "Software" => "software_uk", "Video Games" => "video_games_uk", "Toy" => "toys_uk" );
my %de_catalog_to_mode = ( "Book" => "books_de", "Music" => "pop_music_de", "DVD" => "dvd_de", "Video" => "vhs_de", "Electronics" => "ce_de", "Kitchen" => "kitchen_de", "Software" => "software_de", "Video Games" => "video_games_de", "Magazine" => "magazines_de" );
%all_catalog_to_mode = ( "us" => \%us_catalog_to_mode, "uk" => \%uk_catalog_to_mode, "de" => \%de_catalog_to_mode );
if ($FORM{locale} eq "uk") {
%books_uk = ( "Top Selling" => 1025612, "Address Books, Journals & More" => 507848, "Art, Architecture & Photography" => 91, "Audio Cassettes" => 51, "Audio CDs" => 267859, "Biography" => 67, "Business, Finance & Law" => 68, "Children's Books" => 69, "Comics & Graphic Novels" => 274081, "Computers & Internet" => 71, "Crime, Thrillers & Mystery" => 72, "e-Books" => 637262, "Fiction" => 62, "Food & Drink" => 66, "Gay & Lesbian" => 275835, "Health, Family & Lifestyle" => 74, "History" => 65, "Home & Garden" => 64, "Horror" => 63, "Mind, Body & Spirit" => 61, "Music, Stage & Screen" => 73, "Poetry, Drama & Criticism" => 275389, "Reference & Languages" => 59, "Religion & Spirituality" => 58, "Romance" => 88, "Science Fiction & Fantasy" => 56, "Science & Nature" => 57, "Scientific, Technical & Medical" => 564334, "Society, Politics & Philosophy" => 60, "Sports, Hobbies & Games" => 55, "Travel & Holiday" => 83, "Young Adult" => 52 );
%classical = ( "Top Selling" => 229817, "Classical for Beginners" => 508574, "Composers" => 506476, "Compilations" => 720862, "Occasions" => 508572, "Solo Instrumental" => 505660, "Chamber Music" => 505630, "Orchestral" => 505586, "Ballet & Dance" => 505622 );
%dvd_uk = ( "Top Selling" => 573406, "Action & Adventure" => 501778, "Art House & International" => 501796, "Children's DVD" => 501858, "Classics" => 501976, "Comedy" => 501866, "Drama" => 501872, "DVD Special Offers" => 655852, "Horror & Suspense" => 501880, "Music" => 501888, "Musicals & Classical" => 1108824, "Science Fiction & Fantasy" => 501912, "Sports & Fitness" => 501940, "Television & Documentary" => 501958 );
%electronics_uk = ( "Top Selling" => 560800, "Computer Peripherals" => 561904, "Gadgets" => 3108311, "Handhelds & PDAs" => 560802, "Home Entertainment" => 560858, "Phones" => 560820, "Photography" => 560834, "Portable Audio" => 560884 );
%kitchen_uk = ( "Top Selling" => 3147411, "Cookware" => 3147471, "Cutlery & Knives" => 3147481, "Home Appliances" => 3147451, "Kitchen Accessories & Gadgets" => 3147491, "Kitchen Appliances" => 3147441, "Personal Care" => 3147461 );
%music = ( "Top Selling" => 694208, "The PopShop" => 694266, "Adult Contemporary" => 694228, "Dance Pop" => 694296, "Greatest Hits" => 694212, "Live Albums" => 694214, "Disco" => 694308, "Pop R&B" => 694216 );
%software_uk = ( "Top Selling" => 1025614, "Business" => 600014, "Children's Fun & Learning" => 300473, "Education & Reference" => 300436, "Graphics" => 600136, "Home Computing" => 599892, "Lifestyle & Hobbies" => 300479, "Linux" => 300543, "Macintosh" => 300530, "Programming & Web Development" => 600188, "Video & Music" => 600236 );
%toys_uk = ( "Top Selling" => 595314, "Arts & Crafts" => 595346, "Baby & Pre-school Toys" => 595446, "Cars" => 1161582, "Collectables" => 1095918, "Development & Learning" => 595334, "Dolls & Accessories" => 595376, "Dressing Up & Make-believe" => 595398, "Electronic Toys" => 1193380, "Experiences" => 3052531, "Games & Puzzles" => 595426, "Outdoor Kit" => 1025554, "Playhouses & Tents" => 595406, "Playsets" => 1095914, "Ride-ons" => 1095910, "Skateboards" => 3059981, "Trains" => 595826, "Vehicles" => 1095916, "Wooden Toys" => 1025552 );
%vhs_uk = ( "Top Selling" => 573400, "Action & Adventure" => 283921, "Art House & International" => 283922, "Children's Videos" => 283928, "Classic Films" => 283923, "Comedy" => 283924, "Drama" => 283925, "Fitness Corner" => 283995, "Horror & Suspense" => 283927, "Music & Performing Arts" => 283929, "Science Fiction & Fantasy" => 283930, "Special Interest" => 283931, "Sports" => 283932, "Television & Documentary" => 283933, "Video Special Offers" => 655858 );
%video_games_uk = ( "Top Selling" => 1025616, "Children's PC & Video Games" => 501128, "Game Boy Advance" => 573612, "GameCube" => 660286, "Game Hardware" => 506846, "PC Games" => 300729, "PlayStation 2" => 526776, "PSone" => 300839, "Xbox" => 660202, "Other Platforms" => 725726 );
%store_to_browse = %{$all_store_to_browse{uk}};
%catalog_to_mode = %{$all_catalog_to_mode{uk}};
} elsif ($FORM{locale} eq "de") {
%books_de = ( "Belletristik" => 117, "Börse & Geld" => 120, "Business & Karriere" => 403434, "Computer & Internet" => 124, "Fachbücher" => 288100, "Film, Kultur & Comics" => 548400, "Geist & Wissen" => 119, "Kinder & Jugend Bücher" => 280652, "Kochen & Lifestyle" => 122, "Krimi & Thriller" => 287480, "Lernen & Nachschlagen" => 403432, "Musiknoten" => 1199902, "Naturwissenschaften & Technik" => 121, "Politik, Biografien & Geschichte" => 143, "Ratgeber" => 536302, "Reise & Sport" => 298002, "Science Fiction, Horror & Fantasy" => 142, "Hörbücher" => 300259 );
%books_de_intl_us = ( "Arts & Photography" => 1, "Biographies & Memoirs" => 2, "Business & Investing" => 3, "Children's Books" => 4, "Computers & Internet" => 5, "Cooking, Food & Wine" => 6, "Engineering" => 13643, "Entertainment" => 86, "Gay & Lesbian" => 301889, "Health, Mind & Body" => 10, "History" => 9, "Home & Garden" => 48, "Horror" => 49, "Law" => 10777, "Literature & Fiction" => 17, "Medicine" => 13996, "Mystery & Thrillers" => 18, "Nonfiction" => 53, "Outdoors & Nature" => 290060, "Parenting & Families" => 20, "Professional & Technical" => 173507, "Reference" => 21, "Religion & Spirituality" => 22, "Romance" => 23, "Science" => 75, "Science Fiction & Fantasy" => 25, "Sports" => 26, "Teens" => 28, "Travel" => 27 );
%classical_de = ( "Klassik" => 255966, "Populäre Klassik" => 518124, "Komponisten" => 256029, "Interpreten" => 513528, "Gattungen" => 550142, "Preiswerte Klassik" => 518342 );
%dvd_de = ( "Action, Thriller & Horror" => 289093, "Kinder & Familie" => 290505, "Komödie & Drama" => 290800, "Musik-DVDs" => 289312, "Originalfassungen" => 526774, "Science Fiction & Fantasy" => 548404, "TV & Dokumentationen" => 1027630 );
%ce_de = ( "Computerzubehör" => 700962, "Heimkino & Video" => 761254, "HiFi & Audio" => 571760, "Kamera & Foto" => 571860, "PC & Notebook" => 3034831, "PDA & Organizer" => 569606, "Handy & Telefon" => 571954, "Tragbare Geräte" => 571712, "Zubehör" => 569866 );
%kitchen_de = ( "Elektrische Küchengeräte" => 3169321, "Elektrowerkzeug" => 3527241, "Geschirr, Besteck & Gläser" => 3310821, "Haushaltsgeräte" => 3169211, "Körperpflege & Bad" => 3169021, "Küchengeräte & Kochgeschirr" => 3311201, "Tisch- & Wohnaccessoires" => 3312031, "Wohnen, Garten & Freizeit" => 3312261 );
%pop_music_de = ( "Alternative" => 400118, "Comedy & Kabarett" => 255953, "Dance & Electronic" => 255883, "Diverses" => 255952, "Hard & Heavy" => 264898, "Jazz & Blues" => 255917, "Kindermusik & Hörspiele" => 255956, "Pop" => 264875, "Rap & HipHop" => 255902, "R&B & Soul" => 255895, "Reggae & Ska" => 464356, "Rock" => 264886, "Schlager & Oldies" => 264910, "Songwriter, Folk & Country" => 573044, "Soundtrack & Musical" => 264918, "Weltmusik" => 265502, "Box-Sets" => 1038400, "DVD-Audio" => 772670, "Limited Editions" => 914906, "Maxi-CDs" => 915202, "Super-Audio-CDs" => 914900, "TV-Werbung & Compilations" => 510728 );
%software_de = ( "Betriebssysteme & Tools" => 1064170, "Bildung & Wissenschaft" => 408270, "Büro & Geschäft" => 408288, "Interessen & Unterhaltung" => 408308, "Kinder & Familie" => 408290, "Multimedia & Internet" => 408292, "PDAs & Handhelds" => 505578, "Programmierung & Webdesign" => 408306, "Macintosh" => 910084 );
%magazines_de = ( "Auto & Motorrad" => 1196118, "Computer, Internet & Technik" => 1198616, "Erotik" => 1198618, "Familie, Hobby & Wohnen" => 1198620, "Jugend & Comics" => 1198622, "Mode, Lifestyle & Leute" => 1198628, "Musikzeitschriften" => 1199630, "Reise, Sport & Kultur" => 1198626, "TV & Kino" => 1198630, "Wirtschaft & Politik" => 1198624, "Internationale Presse" => 1198632, "Fachzeitschriften" => 1198634 );
%vhs_de = ( "Action, Thriller & Science Fiction" => 284262, "Kinder & Familie" => 284264, "Komödie & Drama" => 284263, "Musik, TV & Dokumentation" => 284265, "Originalfassungen" => 284267 );
%video_games_de = ( "Computerspiele" => 301129, "Game Boy" => 301014, "Game Boy Advance" => 569128, "GameCube" => 639320, "Nintendo 64" => 301037, "PlayStation" => 300993, "PlayStation 2" => 516838, "Sega Dreamcast" => 301027, "Sega Saturn" => 1198490, "Xbox" => 575708, "Zubehör & Hardware für PC-Spiele" => 643172, "Zubehör & Hardware für Game Boy" => 301026, "Zubehör & Hardware für Game Boy advanced" => 600590, "Zubehör & Hardware für GameCube" => 901948, "Zubehör & Hardware für Nintendo 64" => 408342, "Zubehör & Hardware für PlayStation" => 403624, "Zubehör & Hardware für PlayStation 2" => 516856, "Zubehör & Hardware für Sega Dreamcast" => 301036, "Zubehör & Hardware für Xbox" => 749286 );
%store_to_browse = %{$all_store_to_browse{de}};
%catalog_to_mode = %{$all_catalog_to_mode{de}};
} else {
%apparel = ( "Girls" => 1040664, "Boys" => 1040666, "Infants & Toddlers" => 1044500, "Women - Sleepware" => 1044462 );
%sporting = ( "Airsoft" => 3395111, "Archery" => 3395321, "Badminton" => 3528171, "Baseball & Softball" => 3395731, "Basketball" => 3396541, "Billiards" => 3397051, "Boating" => 3397331, "Bowling" => 3399691, "Boxing" => 3400051, "Camping & Hiking" => 3400371, "Cheerleading" => 3402161, "Climbing" => 3402401, "Cricket" => 3402931, "Cycling & Wheel Sports" => 3403201, "Darts" => 3405651, "Disc Sports" => 3406041, "Diving" => 3406281, "Equestrian Sports" => 3407321, "Exercise & Fitness" => 3407731, "Field Hockey" => 3408621, "Fishing" => 3408951, "Football" => 3410221, "Golf" => 3410851, "Gymnastics" => 3412011, "Hockey" => 3412421, "Hunting" => 3412851, "Kayaking" => 3413781, "Lacrosse" => 3414361, "Lawn Games" => 3414921, "Martial Arts" => 3415011, "Paintball" => 3415511, "Racquetball & Squash" => 3528161, "Rugby" => 3415701, "Running" => 3416071 );
%baby = ( "Top Selling Baby Stuff" => 540988, "Outlet" => 735502, "Activity" => 542460, "Bath & Potty" => 541586, "Feeding" => 541564, "Gear" => 541558, "Health & Safety" => 541580, "Layette" => 738468, "Nursery" => 541572, "Backpacks & Carriers" => 542456, "Car Seats" => 541560, "Strollers" => 541562, "Travel Systems" => 542442, "Playards" => 542468, "Bedding" => 541574, "Furniture" => 541576, "Breast-feeding" => 541568, "Bottle Feeding" => 541566, "Solid Feeding" => 541570, "Highchairs" => 542302, "Play Centers" => 548050, "Swings & Bouncers" => 542470 );
# %books = ( "Outlet" => 733804, "Arts & Photography" => 1, "Biographies & Memoirs" => 2, "Business & Investing" => 3, "Children's Books" => 4, "Computers & Internet" => 5, "Cooking, Food & Wine" => 6, "Engineering" => 13643, "Entertainment" => 86, "Gay & Lesbian" => 301889, "Health, Mind & Body" => 10, "History" => 9, "Home & Garden" => 48, "Horror" => 49, "Law" => 10777, "Literature & Fiction" => 17, "Medicine" => 13996, "Mystery & Thrillers" => 18, "Nonfiction" => 53, "Outdoors & Nature" => 290060, "Parenting & Families" => 20, "Professional & Technical" => 173507, "Reference" => 21, "Religion & Spirituality" => 22, "Romance" => 23, "Science" => 75, "Science Fiction & Fantasy" => 25, "Sports" => 26, "Teens" => 28, "Travel" => 27 );
# HACK - customized node selections
%books = ("Top Mac OS Books" => 3759, "O'Reilly" => 1196050, "Home Office" => 549656, "Database" => 549698, "Desktop Publishing" => 4098, "Graphics & Animation" => 549690, "Personal Finance" => 549688, "Scheduling & E-mail" => 549700, "Spreadsheets" => 549696, "Web Browsers" => 549702, "Web Publishing" => 549694, "Hardware" => 69773 );
%classical = ( "Top Selling Classical" => 85, "Ballets & Dances" => 5260, "Chamber Music" => 5318, "Featured Composers, A-Z" => 5338, "Featured Performers, A-Z" => 38472, "Forms & Genres" => 36632, "Historical Periods" => 36712, "Instruments" => 38374, "Sacred & Religious" => 63654, "Symphonies" => 63681 );
%dvd = ( "Top Selling" => 404276, Outlet => 734006, "Action & Adventure" => 163296, "African American Cinema" => 538708, "Animation" => 712256, "Anime & Manga" => 517956, "Art House & International" => 163313, "Classics" => 163345, "Comedy" => 163357, "Cult Movies" => 466674, "Documentary" => 508532, "Drama" => 163379, "Gay & Lesbian" => 301667, "Horror" => 163396, "Kids & Family" => 163414, "Military & War" => 586156, "Musicals & Performing Arts" => 508528, "Music Video & Concerts" => 163420, "Mystery & Suspense" => 512030, "Science Fiction & Fantasy" => 163431, "Special Interests" => 163448, "Television" => 163450, "Westerns" => 163312, "Boxed Sets" => 501230 );
# %electronics = ( "Top Selling" => 493964, Outlet => 734050, "Accessories & Supplies" => 281407, "Audio & Video" => 1065836, "Computer Add-Ons" => 172455, "Gadgets" => 172517, "GPS & Navigation" => 172526, "Handhelds & PDAs" => 172594, "Office Electronics" => 172574, "Printers" => 172635, "Telephones" => 172606, "DVD Players" => 172514, "VCRs & DVRs" => 172669, "TV & HDTV" => 172659, "MP3 & Digital Audio" => 172630, "Car Accessories" => 226184, "Clocks & Clock Radios" => 509280, "Home Audio" => 172531, "Home Office" => 172574, "Home Video" => 172592, "Portable Audio & Video" => 172623 );
# HACK - customized node selections
%electronics = ( "Top Apple Electronics" => 290609, "Accessories & Media" => 290610, "Audio & Video" => 290659, "Components & Memory" => 290621, "Drives & Mass Storage" => 290625, "Expansion" => 290630, "Input Devices" => 290633, "Modems & Networking" => 290643, "Monitors" => 290652, "PDAs & Handhelds" => 3375151, "Printers & Scanners" => 290669, "Projectors" => 3429921 );
%garden = ( "Top Selling Garden" => 468250, "Outlet" => 734346, "Backyard Birding" => 553632, "Gifts" => 553648, "Grills & Fryers" => 553760, "Heating & Lighting" => 553778, "Sports & Lawn Games" => 892984, "Outdoor Décor" => 553788, "Patio Furniture" => 553824, "Pest Control" => 553844, "Lawn/Garden Tools" => 915484, "Camping" => 892986 );
%kitchen = ( "Top Selling Kitchen" => 491864, "Outlet" => 734070, "Baking" => 289668, "Bar Tools & Glasses" => 289728, "Coffee, Tea & Espresso" => 289742, "Cookware" => 289814, "Cutlery" => 289851, "Housewares" => 510080, "Small Appliances" => 289913, "Tableware" => 289891, "Gadgets" => 289754, "Grills & Fryers" => 553760 );
# %magazines = ( "Top Selling" => 599872, "Arts & Crafts" => 602314, "Automotive" => 602316, "Business & Finance" => 602320, "Computer & Internet" => 602324, "Electronics & Audio" => 602326, "Family & Parenting" => 602330, "Fashion & Style" => 602332, "Food & Gourmet" => 602334, "Games & Hobbies" => 602336, "Health & Fitness" => 602340, "Home & Garden" => 602344, "Men's Interest" => 602352, "Music" => 602354, "News & Politics" => 602358, "Science & Nature" => 602364, "Travel & Regional" => 602370, "Women's Interest" => 602372, "Pets" => 602360, "Children's" => 602322, "Entertainment" => 602328 );
# HACK - customized node selections
%magazines = ( "Top Selling" => 599872, "Arts & Crafts" => 602314, "Automotive" => 602316, "Business & Finance" => 602320, "Computer & Internet" => 602324, "Electronics & Audio" => 602326, "Family & Parenting" => 602330, "Fashion & Style" => 602332, "Food & Gourmet" => 602334, "Games & Hobbies" => 602336, "Health & Fitness" => 602340, "Home & Garden" => 602344, "Men's Interest" => 602352, "Music" => 602354, "News & Politics" => 602358, "Science & Nature" => 602364, "Travel & Regional" => 602370, "Women's Interest" => 602372, "Pets" => 602360, "Children's" => 602322, "Entertainment" => 602328 );
%music = ("Top Selling Music" => 301668, "Outlet" => 734368, "Alternative Rock" => 30, "Blues" => 31, "Children's" => 173425, "Classic Rock" => 67204, "Classical" => 85, "Country" => 16, "Dance & DJ" => 7, "Folk" => 32, "Hard Rock & Metal" => 67207, "Imports" => 701208, "Indie" => 266023, "International" => 33, "Jazz" => 34, "Latin" => 289122, "Miscellaneous" => 35, "New Age" => 36, "Pop" => 37, "R&B" => 39, "Rap & Hip-Hop" => 38, "Rock" => 40, "Soundtracks" => 42, "Hardcore & Punk" => 5196, "Goth & Industrial" => 465946);
# %pc_hardware = ("Top Selling Computers" => 565118, "Desktops" => 565098, "Notebooks" => 565108, "AMD" => 602286, "Apple" => 565124, "HP" => 565120, "IBM" => 603128, "Intel" => 565122, "Sony" => 565126, "Toshiba" => 598398, "Desktops" => 565098, "Accessories & Supplies" => 281407, "Refurbished" => 896918, "Handhelds & PDAs" => 172594, "Monitors" => 172509, "Printers" => 172635 );
# HACK - customized node selections
%pc_hardware = ("Top Apple Hardware" => 565124, "Accessories & Supplies" => 3345561, "iBook Notebooks" => 603156, "iMac Desktops" => 603150, "iPod" => 3221551,"iPod Accessories" => 10836511, "Monitors" => 3221561, "Networking Products" => 3221571, "PowerBook G4" => 603154, "Power Mac G4" => 603158, "Power Mac G5" => 4184571, "Service & Support" => 4184581, "Software" => 3221581 );
%photo = ( "Top Selling Cameras" => 508048, "Outlet" => 733952, "Accessories" => 172435, "Binoculars" => 499320, "Camcorders" => 172421, "Film Cameras" => 499106, "Projectors" => 525462, "Surveillance Systems" => 524136, "Digital Cameras" => 281052 );
# %software = ( "Top Selling Software" => 491286, "Outlet" => 735326, "Business & Office" => 229535, "Children's Software" => 229548, "Graphics" => 229614, "Home & Hobbies" => 229624, "Language & Travel" => 497026, "Linux" => 290562, "Networking" => 229637, "Operating Systems" => 229653, "Personal Finance" => 229540, "Programming" => 229667, "Software for Handhelds" => 229663, "Utilities" => 229672, "Video & Music" => 497022 );
# HACK - customized node selections
%software = ( "Top Selling Software" => 229643, "Business & Office" => 229644, "Children's Software" => 229645, "Communication" => 265765, "Education" => 229646, "Games" => 229647, "Graphics" => 229648, "Home & Hobbies" => 229649, "Networking" => 229650, "OS & Utilities" => 229652, "Programming" => 229651, "Video & Music" => 898090, "Web Development" => 898092 );
%toys = (
#"Top Selling Toys" => 491290,
"Action Figures" => 171662, "Busts & Statues" => 3665861, "Prop Replicas" => 1084108, "Disney" => 3665901, "CCG & Trading Cards" => 3665881, "Art Asylum" => 1080678, "Batman" => 171665, "DC Direct" => 1080682, "Diamond Select" => 3528131, "Digimon" => 288233, "Dragon Ball Z" => 497334, "G.I. Joe" => 185014, "Go-Bots" => 4072401, "Gundam" => 524208, "Harry Potter" => 526290, "Lord of the Rings" => 712316, "Marvel Universe" => 3665851, "Masters of the Universe" => 1080684, "McFarlane" => 1084486, "Movie Maniacs" => 1084488, "NakNak" => 3517121, "Power Rangers" => 565772, "Pokemon" => 265529, "Spawn" => 1084494, "Spider-Man" => 923872, "Star Trek" => 1080690, "Star Wars" => 171673, "TMNT" => 3151521, "Hulk" => 3180141, "Muppets" => 1080692, "Simpsons" => 712346, "Stan Winston" => 712318, "Toy Story" => 642908, "Transformers" => 493822, "Ultimate Soldier" => 284667, "Video Game Characters" => 172103, "WWE" => 172101, "X-Men" => 3180121, "Yu-Gi-Oh!" => 3109731, "Zoids" => 3825711, "HeroClix" => 1196150, "Hot Wheels" => 598670, "Superheroes" => 171687, "Bionicles" => 594688, "Bratz" => 3180101, "Legos" => 171502, "NASCAR" => 3995221, "Neopets" => 3724161, "Nickelodeon" => 642894 );
%universal = ( "Top Selling Tools" => 468240, "Outlet" => 735342, "Automotive Supplies" => 553294, "Electrical" => 495266, "Hand Tools" => 551238, "Hardware" => 511228, "Heating & Cooling" => 495346, "Job Site Equipment" => 551240, "Lawn & Garden Tools" => 551242, "Lighting" => 495224, "Power Tools" => 551236, "Accessories" => 552262, "Air Tools" => 552684, "Cordless Tools" => 552738, "Sanders" => 552876, "Saws"=> 552894, "Painting" => 228899 );
%vhs = ("Top Selling VHS" => 404274, "Action/Adventure" => 141, "Animated Sci-Fi" => 712484, "Animation" => 712260, "Anime" => 281300, "Art House & Foreign" => 126, "Box Sets" => 501232, "Classics" => 127, "Comedy" => 128, "Cult Movies" => 162482, "Disney" => 300374, "Drama" => 129, "Hong Kong Action" => 503172, "Horror" => 131, "Kids & Family" => 132, "Martial Arts" => 139672, "Mystery & Suspense" => 512026, "Sci-Fi & Fantasy" => 144, "Superheroes" => 468044, "Thrillers" => 139706, "Television" => 136, "Westerns" => 139725 );
# %videogames = ( "Top Selling" => 471280, Outlet => 733954, "Game Boy" => 229783, "Game Boy Advance" => 541020, "GameCube" => 541022, "Mac Games" => 229647, "More Systems" => 294940, "Nintendo 64" => 229763, "PC Games" => 229575, "PlayStation" => 229773, "PlayStation2" => 301712, "Sega Dreamcast" => 229793, "Xbox" => 537504, "Linux" => 290573, "NEOGEO" => 541018, "NES" => 566458, "Palm" => 498176, "Sega Game Gear" => 294942, "Sega Genesis" => 294943, "Sega Saturn" => 294944, "Super NES" => 294945 );
# HACK - customized node selections
%videogames = ( "Top Selling Games" => 229647, "Action Games" => 265748, "Adventure & RPG" => 265751, "Classic Arcade" => 265749, "Simulation Games" => 265752, "Sports Games" => 265753, "Strategy Games" => 265754, "Collections" => 265750, "Gaming Hardware" => 290634 );
%store_to_browse = %{$all_store_to_browse{us}};
%catalog_to_mode = %{$all_catalog_to_mode{us}};
}
%sort_hash = ( "+pmrank" => $language_text{sort_text1}, "+salesrank" => $language_text{sort_text2}, "+reviewrank" => $language_text{sort_text3}, "+pricerank" => $language_text{sort_text4}, "+inverse-pricerank" => $language_text{sort_text5}, "+price" => $language_text{sort_text4}, "-price" => $language_text{sort_text5}, "+daterank" => $language_text{sort_text6}, "+titlerank" => $language_text{sort_text7}, "-titlerank" => $language_text{sort_text8}, "+manufactrank" => $language_text{sort_text9}, "-manufactrank" => $language_text{sort_text10}, "+artistrank" => $language_text{sort_text11}, "+orig-rel-date" => $language_text{sort_text12} );
%sort_hash_by_mode = (
"all" => ["+titlerank","+salesrank","+pmrank"],
"books" => ["+pmrank","+salesrank","+reviewrank", "+daterank","+titlerank","-titlerank"],
# "books" => ["+pmrank","+salesrank","+reviewrank","+pricerank","+inverse-pricerank","+daterank","+titlerank","-titlerank"],
"software" => ["+pmrank","+salesrank","+titlerank"],
# "software" => ["+pmrank","+salesrank","+titlerank","-price","+price"],
"garden" => ["+pmrank","+salesrank","+titlerank","-titlerank","+manufactrank","-manufactrank","+price","-price"],
"universal" => ["+pmrank","+salesrank","+titlerank","-titlerank","+manufactrank","-manufactrank","+price","-price"],
"photo" => ["+pmrank","+salesrank","+titlerank","-titlerank"],
"pc_hardware" => ["+pmrank","+salesrank","+titlerank","-titlerank"],
"videogames" => ["+pmrank","+salesrank","+titlerank"],
# "videogames" => ["+pmrank","+salesrank","+price","-price","+titlerank"],
"music" => ["+pmrank","+salesrank","+artistrank","+orig-rel-date","+titlerank"],
"classical" => ["+pmrank","+salesrank","+artistrank","+orig-rel-date","+titlerank"],
"office_products" => ["+pmrank","+salesrank","+reviewrank","+price","-price","+titlerank","-titlerank"],
"electronics" => ["+pmrank","+salesrank","+reviewrank","+titlerank","-titlerank"],
"kitchen" => ["+pmrank","+salesrank","+titlerank","-titlerank","+manufactrank","-manufactrank","+price","-price"],
);
%offering_type = ( new => "ThirdPartyNew", used => "Used", collectible => "Collectible", refurbished => "Refurbished" );
%chat_modes = ( photo => 502394, electronics => 172282, videogames => 468642, books => 283155, music => 5174, dvd => 130, toys => 171280 );
}
# build the products_html
if ($FORM{cart_action}) {
shopping_cart();
} elsif ( ($FORM{mode} and ($FORM{input_string} or $FORM{node}) and ($FORM{mode} ne "blended")) or $FORM{item_id} =~ /,/ or $FORM{search_type} =~ /(?:ThirdPartyNew|Used|Collectible|Refurbished|ListManiaSearch|SimilaritySearch|WishlistSearch)/) {
# get products
my $this_xml_url="http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&$query&f=xml&sort=$FORM{sort_type}&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
if ($FORM{search_type} =~ /(?:ThirdPartyNew|Used|Collectible|Refurbished|ListManiaSearch|SimilaritySearch|WishlistSearch)/) { $this_xml_url="http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&$query&f=xml&locale=$FORM{locale}"; }
my $xml_result = get_url($this_xml_url);
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
if ($AWS_variables{TotalResults} eq 1) {
${${$level_1}{Details}}[0] =~ /([^<]+)<\/Asin>/;
delete $MY_variables{header}; delete $FORM{mode}; delete $FORM{input_mode}; delete $FORM{node}; $FORM{search_type} = "AsinSearch"; $FORM{item_id} = "$1";
goto START_PROCESSING_LABEL; # yes i know goto is lame, bite me
} else {
assign_variables("products",$level_1);
}
} elsif ($FORM{search_type} =~ /(?:AsinSearch|CustomerReviews)/) {
# get item by ASIN/ISBN
my $this_xml_url = "http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&AsinSearch=$FORM{item_id}&type=heavy&f=xml&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $xml_result = get_url($this_xml_url);
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
if ($FORM{search_type} eq "CustomerReviews") {
assign_variables("customer_reviews",$level_1);
} else {
assign_variables("item",$level_1);
}
$MY_variables{store} = $lookup_store{$catalog_to_mode{$AWS_variables{Catalog}}}; $MY_variables{subject} = $AWS_variables{ProductName};
} elsif ($FORM{search_type} eq "UpcSearch") {
# get item by UPC
my $this_xml_url = "http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&UpcSearch=$FORM{item_id}&mode=$FORM{mode}&type=heavy&f=xml&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $xml_result = get_url($this_xml_url);
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
assign_variables("item",$level_1);
$MY_variables{store} = $AWS_variables{Catalog};
$MY_variables{subject} = $AWS_variables{ProductName};
} elsif ($FORM{mode} eq "blended") {
# blended search
# HACK BELOW - Include Blended as a "type=heavy" search
my $this_xml_url = "http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&BlendedSearch=$FORM{input_string}&type=heavy&f=xml&locale=$FORM{locale}";
#my $this_xml_url = "http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&BlendedSearch=$FORM{input_string}&type=lite&f=xml&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $xml_result = get_url($this_xml_url);
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
blended_search($level_1);
} elsif ($FORM{search_type} eq "image") {
# get large image
my $this_xml_url="http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&AsinSearch=$FORM{item_id}&type=lite&f=xml&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $xml_result = get_url($this_xml_url);
$xml_result =~ s/<([^>]+)>([^<]+)<\/\1>/$AWS_variables{$1} = $2;/gsie;
$MY_variables{store} = $AWS_variables{Catalog};
$MY_variables{subject} = $AWS_variables{ProductName};
$MY_variables{products_html} .= set_html("larger_image");
} elsif ($FORM{search_type} eq "SellerSearch") {
# get SellerProfile
my $this_xml_url="http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&SellerProfile=$FORM{input_string}&type=lite&f=xml&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $xml_result = get_url($this_xml_url);
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
assign_variables("sellerprofile",$level_1);
$MY_variables{store} = $AWS_variables{Catalog};
$MY_variables{subject} = $AWS_variables{ProductName};
# get SellerSearch
my $this_xml_url="http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&$query&f=xml&sort=$FORM{sort_type}&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $xml_result = get_url($this_xml_url);
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
assign_variables("sellersearch",$level_1);
} elsif ($FORM{search_type} eq "ExchangeSearch") {
# get ExchangeSearch
my $this_xml_url="http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&$query&f=xml&sort=$FORM{sort_type}&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $exchange_xml_result = get_url($this_xml_url);
$exchange_xml_result =~ s/([^<]+)<\/ExchangeSellerId>/$AWS_variables{ExchangeSellerId} = $1/e;
# get SellerProfile
my $this_xml_url="http://$amazon_server.amazon.com/onca/xml3?t=$MY_variables{associate_id}&dev-t=D1KQJBNTALRLQH&SellerProfile=$AWS_variables{ExchangeSellerId}&type=lite&f=xml&locale=$FORM{locale}";
$debug .= "xml_url=$this_xml_url\n";
my $xml_result = get_url($this_xml_url);
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
assign_variables("sellerprofile",$level_1);
# get ExchangeSearch
my $xml_result = $exchange_xml_result;
my $level_1 = parse_xml_into_hashes_of_arrays($xml_result);
assign_variables("sellersearch",$level_1);
} elsif ($FORM{search_type} eq "AllSearches") {
assign_variables("AllSearches");
} elsif ($FORM{search_type} eq "power_search_info") {
$MY_variables{store} = "PowerSearch"; $MY_variables{subject} = "Details";
$MY_variables{products_html} .= set_html("power_search_info");
} elsif ($FORM{mode}) {
# display the categories for the mode
$nav_menu_type = "modes";
$MY_variables{subject} = $language_text{header_text5};
$MY_variables{header} = qq[$language_text{header_text1} > $MY_variables{store}
];
$MY_variables{products_html} = load_browse_table(\%{$FORM{mode}}, "mode=$FORM{mode}&node=");
if (exists($chat_modes{$FORM{mode}})) {
$MY_variables{chat_link} = qq[Chat about $lookup_store{$FORM{mode}}
];
}
} else {
# display the modes
$nav_menu_type = "none";
$MY_variables{subject} = $language_text{header_text1}; $MY_variables{store} = $language_text{header_text4};
# HACK BELOW - Custom HomePage
$MY_variables{products_html} = set_html("homepage");
# $MY_variables{products_html} = load_browse_table(\%store_to_browse, "mode=");
}
# HACK BELOW strip HTML out
$MY_variables{subject} =~ s/<[^>]+>//g;
# build the page
if ($FORM{search_type} eq "SimilaritySearch") { $MY_variables{header} = qq[$language_text{my_similar_products_text1} $language_text{button_text4}]; }
elsif ($FORM{search_type} eq "ListManiaSearch") { $MY_variables{header} = "$AWS_variables{ListName}"; }
elsif (!$MY_variables{header}) { $MY_variables{header} = qq[$MY_variables{store} : $MY_variables{subject}]; }
if ($MY_variables{error_msg}) { $MY_variables{products_html} .= qq[$MY_variables{error_msg}
]; }
if ($debug_state eq "on") { $MY_variables{debug_html} = $debug; }
build_search_box();
if (!$AWS_variables{HMAC}) { build_international_links(); }
$html .= set_html("page");
# HACK BELOW
$apf_footer = qq[];
# $apf_footer = qq[script by MrRat];
if ($MY_variables{associate_id} =~ /(freewarfrommrrat|mrratcom-21)/) { $apf_footer .= qq[
A portion of each sale goes to benefit MrRat.com, thank you.]; }
# HACK BELOW - Change "No Image" image
$apf_footer .= qq[\n];
# $apf_footer .= qq[\n];
# HACK BEGIN - Fix footer output
$apf_footer .= qq[