Results 1 to 12 of 12
  1. #1
    Outsourced Program Manager Chris -  AMWSO's Avatar
    Join Date
    January 18th, 2005
    Location
    Bangkok
    Posts
    11,273
    Bill Bam Collectibles Data Feed Udpated
    Hi Everyone

    The Free FTP Data Feed for Bill Bam's Collectibles on SAS has been sent for update should be live within a day or two.

    Cheers

    Chris
    Affiliate Marketing by AMWSO. Skype - chrissanderson ::: TEL 1-720-336-1784 ::: www.amwso.net
    Join our affiliate programs :Vaper Empire, Iolo, Art of Tea, or See ALL our Programs here

  2. #2
    Troll Killer and best Snooper!
    I decide when the pigs fly!
    Rhea's Avatar
    Join Date
    January 18th, 2005
    Location
    New York, USA
    Posts
    6,195
    Thanks Chris!

  3. #3
    Outsourced Program Manager Chris -  AMWSO's Avatar
    Join Date
    January 18th, 2005
    Location
    Bangkok
    Posts
    11,273
    Dat Feed Updated Feb 18
    Bill Bam's Data Feed has been updated, roughly 1180 products listed, including the new Barbie 2005 collection so bundle that with the BARBIE5 discount coupon

    Cheers

    Chris
    Affiliate Marketing by AMWSO. Skype - chrissanderson ::: TEL 1-720-336-1784 ::: www.amwso.net
    Join our affiliate programs :Vaper Empire, Iolo, Art of Tea, or See ALL our Programs here

  4. #4
    ABW Ambassador Greg Rice's Avatar
    Join Date
    January 18th, 2005
    Location
    Ohio
    Posts
    4,889
    Does anyone know what parameters to use when importing this feed into mySQL? Seems no matter what I use I only get 1 line. The 1 line is complete but it doesn't load the following lines. I have this same problem with all SAS feeds.

  5. #5
    Outsourced Program Manager Chris -  AMWSO's Avatar
    Join Date
    January 18th, 2005
    Location
    Bangkok
    Posts
    11,273
    Hi Xandman

    Drop me an email with what you are doing and scripts you are doing, you know all the stuff my programmers would understand but I'm not sure what it's called and I'll ask them to have a look for you.

    Cheers

    Chris
    Affiliate Marketing by AMWSO. Skype - chrissanderson ::: TEL 1-720-336-1784 ::: www.amwso.net
    Join our affiliate programs :Vaper Empire, Iolo, Art of Tea, or See ALL our Programs here

  6. #6
    Newbie
    Join Date
    January 18th, 2005
    Posts
    27
    What are you using to import the datafeed? myphpadmin?

  7. #7
    Outsourced Program Manager Chris -  AMWSO's Avatar
    Join Date
    January 18th, 2005
    Location
    Bangkok
    Posts
    11,273
    Hi atoning. yes he is, do you have some clues for us That would be great!

    xandman, reply in your mail box

    Cheers

    Chris
    Affiliate Marketing by AMWSO. Skype - chrissanderson ::: TEL 1-720-336-1784 ::: www.amwso.net
    Join our affiliate programs :Vaper Empire, Iolo, Art of Tea, or See ALL our Programs here

  8. #8
    Newbie
    Join Date
    January 18th, 2005
    Posts
    27
    I think some versions of myphpAdmin barf because of the way the datafeed file is delimited (ie with a pipe | and no double quotes for text fields). What I do when sussing out the datafile is import it into Navicat (from www.navicat.com free 30 day trial version - incidently ranks about number 9 on my Cool Tool Ranking System :-) ) Then you can export it into any format you want even an SQL query. You can also load the SAS datafeed into Excel and sae it as an Excel workbook and import that into Navicat.

    Navicat requires that you have the Windows version of MYSQL installed and running (mysqld.exe). There is a version of Navicat available for all platforms including Macincrap (oops did I say that?).

    Mt preferred method of importing a SAS DF is just to read the gzip file you get from ftp access. Code snippet below:

    $f_data=gzopen($dataFeedFileLocation . $dataFeedFileName, "r");
    while (!gzeof($f_data)) {
    $record= explode("|",gzgets($f_data));
    ....
    ....

    Using gzopen lets you rad a line at a time from a compressed file without having to decompress it, tre cool! The whole process is pretty simple and releases you from having to use myPHPadmin to import the data as it does seem to fall over a lot on my host.

    /\

  9. #9
    ABW Ambassador Greg Rice's Avatar
    Join Date
    January 18th, 2005
    Location
    Ohio
    Posts
    4,889
    Thanks atoning. Can you point me to some information that would help explain this process? I'm looking to understand how I could use the code you provided. Currently I use phpMyAdmin to manage my tables. Does your code go into a php page? Where is the zipped file (on the server, your local pc) when you start the import?

  10. #10
    ABW Ambassador
    Join Date
    January 17th, 2005
    Posts
    530
    I use phpMyAdmin to upload the datafeeds to my server, and haven't had any
    problems with any of them yet, 18 datafeeds so far this way. Where it has Fields
    terminated by ; I change to Fields terminated by |. Just change the semicolon to a
    pipe symbol. Then where it says Fields enclosed by " I just remove the quotes and
    leave it empty. I leave everything else the way it is, click on Submit and it uploads
    no problems.

  11. #11
    Newbie
    Join Date
    January 18th, 2005
    Posts
    27
    Here is my SAS import routine, this one checks to see if the products table exists and if it doesnt creates the table in the given database. The SQL for creating the tables in the database is setup in a config file elsewhere if you need to look at that I will post the SQL. The calling module (index.php) checks to see if a new datafile exisits in a data directory and if it does then import.php is called. When import.php is completed it deletes the Datafeed file and quits. Before qutting the import.php file can also execute and post import SQL statement, I use this option to delete products I dont want in the database table as I often use the same feed across different sites but want to change a few things. It can also be used for other things as well such as changing the outgoing link or image link to somethign different.

    Hope this is helpful!


    // Data Import Module
    // This module check to see if a new products datafile is available in the /data directory
    // and if it does then its is imported into the products table.
    //

    function mysql_table_exists($tableName,$host,$user,$db,$dbPassword) {
    //Verifies that a MySQL table exists
    $tableFound = FALSE;
    $link=mysql_connect($host,$user,$dbPassword);
    $result = mysql_list_tables($db);
    while ($row=mysql_fetch_row($result)) {
    if ($row[0] == $tableName) {
    $tableFound = TRUE;
    break;
    }
    }
    mysql_free_result($result);
    mysql_close($link);
    return ($tableFound);
    }



    function importData($productsTable,$host,$user,$dbPassword,$db,$dataFileLocation,$dataFileName,$affiliateID,$postImportSQL,$productsSQL) {

    if (file_exists($dataFileLocation . $dataFileName)) { // We have a new data file and its open for reading
    $link=mysql_connect($host,$user,$dbPassword);
    if (mysql_table_exists($productsTable,$host,$user,$db,$dbPassword)) {
    $strSQL="DROP TABLE ". $productsTable;
    $result=mysql_db_query($db,$strSQL,$link);
    if (!$result) {
    die('
    Error while trying to drop table products in import.php: ' . mysql_error());
    }
    }
    $strSQL=$productsSQL;
    $link=mysql_connect($host,$user,$dbPassword);
    $result=mysql_db_query($db,$strSQL,$link);
    if (!$result) {
    die('Error while trying to create products table in import.php: ' . mysql_error());
    }
    $f_data=gzopen($dataFileLocation . $dataFileName, "r");
    $i=0;
    while (!gzeof($f_data)) {
    $record= explode("|",gzgets($f_data));
    $strSQL="INSERT INTO ". $productsTable ." (ProductID,Name,MerchantID,Merchant,Link,Thumbnail,BigImage,Price,RetailPrice,Category,SubCategory,Description,Custom1,Custom2,Custom3,Custom4,Custom5,LastUpdated) VALUES (";
    $strSQL=$strSQL ."'". addslashes($record[0]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[1]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[2]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[3]) ."',";
    $strSQL=$strSQL ."'". addslashes(str_replace("YOURUSERID",$affiliateID,$record[4])) ."',";
    $strSQL=$strSQL ."'". addslashes($record[5]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[6]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[7]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[8]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[9]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[10]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[11]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[12]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[13]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[14]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[15]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[16]) ."',";
    $strSQL=$strSQL ."'". addslashes($record[17]) ."')";
    $result=mysql_db_query($db,$strSQL,$link);
    if (!$result) {
    die("OOPS!! Bad things happend during the products table import on record ".$i .". MySQL Says: " . mysql_error());
    }
    $i++;
    } // End while
    gzclose($f_data);
    unlink($dataFileLocation . $dataFileName);
    if (!$postImportSQL == "") { //We have some database cleaning up to perform
    $result=mysql_db_query($db,$postImportSQL,$link);
    if (!$result) {
    die('OOPS!! Bad things happend during the post import cleaning up process. MySQL Says: ' . mysql_error());
    } // end if
    } // end if
    } // end if
    } // end function
    ?>

  12. #12
    Member
    Join Date
    June 10th, 2006
    Posts
    112
    Thanks. Very useful
    [LEFT]-[URL=http://www.ableaffiliate.com]www.AbleAffiliate.com[/URL]-
    :approval:
    Free Affiliate Program Directory for Submission[/LEFT]

  13. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Bill Bam Live on DatafeedFile easy free Data Feed.
    By Chris - AMWSO in forum AMWSO
    Replies: 0
    Last Post: August 27th, 2006, 09:17 PM
  2. Bill Bam data feed & showcase update
    By Jamie - AMWSO in forum AMWSO
    Replies: 0
    Last Post: March 8th, 2006, 07:09 AM
  3. Bill Bam Data Feed Updated
    By Jamie - AMWSO in forum AMWSO
    Replies: 0
    Last Post: July 4th, 2005, 12:10 AM
  4. Bill Bam Data Feed Update
    By Chris - AMWSO in forum ShareASale - SAS
    Replies: 4
    Last Post: November 14th, 2004, 12:22 AM
  5. Bill Bam Data Feed Update
    By Chris - AMWSO in forum ShareASale - SAS
    Replies: 7
    Last Post: August 14th, 2004, 08:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •