Building a Datafeed Site – Step 2

March 8th, 2010 → 12:59 pm @ Eric Nagel // 3 Comments

By now, we have selected the niche and chosen a template, added some supporting files and created the database, and are now ready to populate the products table with actual products!

The first step, if you haven’t done so already, is to download the datafeed from the ShareASale website. While many merchants offer FTP access, and we could automate this a bit more, it’s easier when getting started to upload the data manually (yeah, uploading a zip of the datafeed is “manual” to me).

You’ll need to create a “temp” folder, chmod it to 777 so the script can write to it, and maybe change where your unzip program sits on your server (line 17)

The script to load the products table isn’t terribly long, but I’m not going to paste the whole thing in this blog post. So…

Download the file here

Then, upload the file to your website, go to yourdomain.com/admin-sas-datafeed.php and click on the “Choose File” button, then select the zip file from your computer, and click “Upload”.
Uploading data

What this does is unzips the .zip file, reads the .txt file and if there’s a new product, adds it to the database. If the product already exists, it gets updated. Finally, any product that wasn’t just added or updated, gets removed.

Repeat as necessary for each merchant that you’re working with.

This step isn’t very long, or difficult (considering I give you everything you need!) but it’s exciting as now you have a database full of products, ready to display on your website!

Next up… we’ll work on the display of the products.


Tags: , , ,

3 Comments → “Building a Datafeed Site – Step 2”


  1. Panda

    2 months ago

    Hey Eric, when do you swap in your affiliate ID?


  2. Eric Nagel

    2 months ago

    @Panda: about line 75
    $rsItem[$rsMap['Link']] = str_replace(‘YOURUSERID’, $nSASID, $rsItem[$rsMap['Link']]);


  3. Panda

    2 months ago

    Oh yeah, I forgot about the vars file.
    /me slaps head.

    James was wondering if it was only for SAS and I said yeah. Others want to know if it will work with WP, as well as I. Now that WP3.0 is out, I wonder if it were possible.

    Oh well.


Leave a Reply