Mashup Script Setup Guide

This is a quick guide to getting up and running with my modified version of the 45n5 mashup script.

Some of the steps are probably quite obvious but I thought if i’m going to do a guide for this I may as well include all steps, hopefully this helps some people out there who might not be so technically minded.

  1. Get your domain name and webhosting
    This is probably quite an obvious step, but before you can use the script you need to have your domain name and web hosting. One thing that you do need on your hosting is PHP. I won’t go into too much detail on how to go about getting hosting, but if you aren’t sure then feel free to contact me and i’ll do my best to help out.If you don’t already have hosting then I would recommend eUKHost. This is who I am hosted with and they have some really good features and decent prices.
  2. Download the mashup script
    Get the script from here. Put this somewhere on your PC and unzip it.
  3. Edit the script
    Don’t worry if you’re not comfortable with changing code… you just need to change a couple of values in a couple of the files. Easy.

    • Open the stufftochange.php file in your favourite text editor. Here are the variables you can change here:
      • $siteurl - self explanatory really, just put your own domain name in
      • $TrackingID - put your eBay Partner Network campaign ID here. If you’re not yet signed up eith ePN then go to https://www.ebaypartnernetwork.com/ and join them.
        Once you’ve signed up log in and go to the Campaigns tab and you’ll find your default campaign ID there.
      • $TrackingPartnerCode - You don’t need to change this, this should always be set to 9 so we use the ePN.
      • $CustomID - You can set this to whatever you like, this will be useful for tracking if you use this script on multiple sites.
      • $AppID - This is your eBay developer ID and is needed to access the eBay API. You first need to join the eBay developer network here http://developer.ebay.com/. Once you’re signed up, log in then go to My Account, then under Application keys click on the Generate Production Keys link. Once you’ve done that, click on Key Set 1 and you’ll see your App ID.
      • $CurrencySymbol - This is the currency sign used for eBay prices. By default it’s set to the £ sign (although I had to set it as £ because it wasn’t working). Just set to $ if you want to use eBay US.
      • $amazonid - This is your Amazon Developer Access Key ID, and this is required to use the Amazon API. To get your Access Key ID go to http://aws.amazon.com/ and sign up. Once you’ve logged in, go to your web services account then AWS access identifiers. Here you’ll find your Access Key ID.
      • $amazontag - Your Amazon affiliate ID. Sign up here https://affiliate-program.amazon.co.uk/ (or https://affiliate-program.amazon.com/ for US). Your tracking ID is what you need here.
      • $searchindex - This is the area of Amazon to show results from. By default this is set to Blended which will display from the main areas of the Amazon site. Take a look at http://docs.amazonwebservices.com/AWSECommerceService/2007-04-04/DG/SearchIndices.html for all options.
    • Open inc\ebaysearch.php, then scroll down to the ebay section. The only variables you need to worry about here really are:
      • $SiteID - This tells the eBay API which site to get results from. Set this to 3 for eBay UK, or 0 for eBay US. You can get the full list of site IDs here http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/types/SiteCodeType.html. This variable also determines which Amazon site is used. If it’s set to 3 then the script will use Amazon UK, any other setting will use Amazon US.
      • $EntriesPerPage - Pretty straightforward, just change this to however many results you want returned. Maximum is 50.
    • Open products.txt. This is where you’ll enter all your products/keywords. Simply type out your list and this is what the script will use to build the menu and search eBay, Amazon and YouTube.
  4. Upload the script to your site
    Grab your favroutie FTP program and upload the whole script directory. The only real requirement here is that you upload to the root of your site, ie. www.yourdomain.com, or the root of a subdomain, subdomain.yourdomain.com.

After setting this up I would highly recommend uploading my sitemap script to the root of your site, then submitting that to Google.

Hopefully that covers everything. As always if anyone needs any help setting this up, or if you come across any errors then feel free to contact me.

Sitemap Generator for the mashup script

Just a quick post to say that i’ve written a script that will generate a valid XML sitemap that can be used, for example, with Google Sitemaps. The script runs through all the keywords in the products.txt file, builds the URL in the same way that they are created when someone browses to the site, and outputs it in XML. Change frequency is set to daily for every URL, and the priority is set to 1.0. You should be able to find and change that easily enough if you want to.

All you have to do with this is download the script (zipped) below and extract sitemap.php to the root of your script directory. Then, assuming you are submitting to Sitemaps in Google Webmaster Tools, submit http://www.yourdomain.com/sitemap.php. That’s it! Google will download your sitemap, hopefully daily, and it will automatically contain all your URLs, even if you add new keywords to products.txt.

Download the sitemap script here.

My modified version of the 45n5 mashup script

As I mentioned in the last post I have modified the mashup script from 45n5.com so that it now works with the new eBay Partner Network. I also tweaked a few other things to how I wanted it, others may not like those changes so feel free to remove any of that.

From what I could find you can no longer use the GetSearchResults eBay API call (or maybe I just didn’t look hard enough…), so I had a look through eBay’s developer site and found the FindItems call which I think does pretty much the same thing, and it certainly is enough for what I wanted. I also couldn’t find a way of using the new eBay API calls without having an eBay Developer account and App ID (please let me know if anyone knows of a way that you don’t need an App ID), so to use the script you’ll have to sign up with the eBay Developers Program and generate a production app ID.

The script is still very much based on the original from 45n5, and as in the original you still need to modify some variables in the stufftochange.php file, and add your keywords to the products.txt file.

As well as getting the eBay stuff working with the new affiliate network the other tweaks I have made are:

  • Added time remaining, current price and current bids to the eBay listings
  • Aligned the eBay images and text a bit more neatly
  • Removed the bottom AdSense text banner
  • Added an AdSense box underneath the “Auctions for…” section
  • Put a bit of vertical space between the different sections (ie. between “Video for…” and “Shop for…”) just so they’re not so bunched up

There’s probably alot more that can be done with this script and I will work some more on it in the near future, although I have alot on for the next week or so, so i’ll have to wait a little while before I can have another play ;).

If anyone notices any problems with this version the please contact me and i’ll try my best to fix it. Also, if anyone digs through the code, please don’t laugh at my amateur coding skills… but i’d be happy to hear of any tips or improvements I could make.

I’ve put a up a quick demo here for you to take a look at.

** UPDATE on 6th July 2008 **
I’ve made a couple of minor changes to the script:

  • Changed the way the eBay call is done (now uses cURL instead of simplexml_load_file. This is mainly due to support of the simplexml call being turned off on some web hosts.
  • Fixed an issue where ebay/Amazon could return a valid XML result but with no items, then the script would still display the heading “auctions for..” etc. but no listings. Now if there are no items then that section is completely left out.
  • Amazon now displays items from amazon.co.uk if the SiteID variable (set under the ebay section in ebaysearch.php) is set to 3 for UK, otherwise shows items from amazon.com.
  • Tweaked the way the Amazon items are displayed

Download the script here.

Also check out my mashup script sitemap generator.

Update on my first mashup site

I worked today on modifying the mashup script I mentioned in my last post to work with the new eBay Partner Network and I’ve got it into a working state and tweaked a few other things to how I want it to look. I threw together some keywords and have put up an initial site using the script, and I think it works very well! I am on the road all day tomorrow so won’t be able to touch it anymore until Friday, but i’m hoping to get some time to tweak it a little more and maybe work on a few design elements and think through my keywords a bit more.

I’m really excited about the potential for this script, once i’ve modified it to my needs it will make it extremely easy to throw up similar sites in future.

I’ll tidy up my changes to the script before the end of the weekend and post it here so anyone who is interested can use it themselves.