Posted May 20th, 2008
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.
Posted May 17th, 2008
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.