spacely Posted April 6, 2006 Share Posted April 6, 2006 Hi, would like to use EZpopulate for creating Froogle feeds. I have tried to install several diferenet versions but havent found one that works with this fature. What is the Current WORKING build of Ezpopulate that will export a Froogle data feed? Thank you. Cosmo Spacely "No hurry, any time in the next 5 minutes is fine." Quote Cosmo Spacely, C.E.O. Link to comment Share on other sites More sharing options...
Guest Posted April 6, 2006 Share Posted April 6, 2006 Hi, would like to use EZpopulate for creating Froogle feeds. I have tried to install several diferenet versions but havent found one that works with this fature. What is the Current WORKING build of Ezpopulate that will export a Froogle data feed? Thank you. Cosmo Spacely "No hurry, any time in the next 5 minutes is fine." Well as long as you have easy populate working just install the froogle contribution... should work like a charm. Quote Link to comment Share on other sites More sharing options...
spacely Posted April 9, 2006 Author Share Posted April 9, 2006 Well as long as you have easy populate working just install the froogle contribution... KEY WORD=>should ;] work like a charm. liFE IS nOT sUpposed tO Be eAsY Quote Cosmo Spacely, C.E.O. Link to comment Share on other sites More sharing options...
spacely Posted April 9, 2006 Author Share Posted April 9, 2006 liFE IS nOT sUpposed tO Be eAsY Here is some .php code that I stole/modified from another part of contribution support that worked for me to get the basic froogle .CSV If you use it you will need to configure for your set-up. <?php $OutFile = "myFROOGLEregisteredFILENAME.txt"; $destination_file ="unix/SERVER/path/TO/myFROOGLEregisteredFILENAME.txt"; $source_file = $OutFile; $imageURL = 'relativeORabsolute/PATHtoMYcatalog/images/'; $productURL = 'relativeORabsolute/PATHtoMYcatalog/product_info.php?products_id='; $home = "USUALLYlocalhost"; $user="MYSQLusernameFROMadmin"; $pass="MYSQLpasssFROMadmin"; $base="MYSQLdbNAME"; $ftp_server = "hedwigORanother.google.com"; $ftp_user_name = "myFroogleUSERNAME"; $ftp_user_pass = "myFrooglePASSWORD"; if (!($link=mysql_connect($home,$user,$pass))) { echo "Error when connecting itself to the data base"; exit(); } if (!mysql_select_db( $base , $link )) { echo "Error the data base does not exist"; exit(); } $sql = " select concat( '$productURL' ,products.products_id) AS product_url, products_description.products_name AS name, products_description.products_description AS description, FORMAT(products.products_price,2) AS price, CONCAT( '$imageURL' ,products.products_image) AS image_url, concat_ws( ' > ' , catdescparent.categories_name , catdesccurrent.categories_name ) AS category FROM categories , products, products_description, categories_description as catdesccurrent, products_to_categories left join categories_description as catdescparent on ( catdescparent.categories_id = categories.parent_id ) WHERE products.products_id=products_description.products_id AND products.products_id=products_to_categories.products_id AND products_to_categories.categories_id=categories.categories_id AND catdesccurrent.categories_id = categories.categories_id "; $_strip_search = array( "![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars '%[\r\n]+%m'); // remove CRs and newlines $_strip_replace = array( '', ''); $output = "product_url\t name\t description\t image_url\t category\t price \n"; $result=mysql_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) ); while( $row = mysql_fetch_object( $result ) ) { $output .= $row->product_url . "\t" . preg_replace($_strip_search, $strip_replace, strip_tags( $row->name ) ) . "\t" . preg_replace($_strip_search, $strip_replace, strip_tags( $row->description ) ) . "\t" . $row->price . "\t" . $row->image_url . "\t" . $row->category . "\n"; } if ( file_exists( $OutFile ) ) unlink( $OutFile ); $fp = fopen( $OutFile , "w" ); $fout = fwrite( $fp , $output ); fclose( $fp ); /* ftp upload using this cscript ////////////////////////////////// //THIS part didn't work for me // just uploaded the CSV to froogle manually ///////////////////////////////// // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!<BR>"; echo "Attempted to connect to $ftp_server for user $ftp_user_name<BR>"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name<BR>"; } // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!<BR>"; } else { echo "Uploaded $source_file to $ftp_server as $destination_file<BR>"; } // close the FTP stream ftp_close($conn_id); */ ?> Quote Cosmo Spacely, C.E.O. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.