Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically send data feed to Froogle


gottaloveit

Recommended Posts

I've been using Froogle Data Feeder v1 since Feb 2005 on two sites without problems. My last successful feeds were sent on Dec. 1st

 

I tried to send feeds from both sites yesterday and again today with the following error:

 

File completed: [FROGGLENAME].txt

Connected to hedwig.google.com, for user [FROGGLEUSERNAME]

 

Warning: ftp_put(): [FROGGLENAME].txt: Permission denied on server. (Overwrite) in /home/XXXX/XXXX/admin/froogle.php on line 344

hedwig.google.com: FTP upload has failed!

 

Has something changed with Froggle that is not letting the txt file be overwritten or could it be my host [two different servers]?

 

Thanks,

Maureen

 

Either you tried to upload before Froogle picked up your file or your hosting does not allow FTP's. Try setting it to passive mode. There's instructions somewhere in this topic.

 

I'll contact the moderators today about this contribution. They took it down without warning a week ago, which irritated me quite a bit.

Most likely your question has been answered, please do a search first.

Link to comment
Share on other sites

FYI I wrote a shopzilla feed. I'll upload it to the contributions after I get it all working correctly.

 

Justin

:thumbsup:

 

 

that is great. Thanks for taking time.

 

my another conern is shopping.com, registered already. However, haven't got chance to get a working one.

 

 

sean

Link to comment
Share on other sites

I have a shopping.com feed modified from this contribs froogle.php file but i dont think you can automate it to upload to shopping.com (I may be wrong as only just set up this shopping.com) but it doesnt appear to let you ftp the feed file up. It has an online form to upload it ?

Link to comment
Share on other sites

it's possible, i've done it before for shopping.com... you can set it up for pick up i believe instead of ftp (or maybe it was ftp). it's automated on my client's systems.

 

i'll try to repost and get the froogle data feeder contribution verified by the moderators this week.

Most likely your question has been answered, please do a search first.

Link to comment
Share on other sites

I have a shopping.com feed modified from this contribs froogle.php file but i dont think you can automate it to upload to shopping.com (I may be wrong as only just set up this shopping.com) but it doesnt appear to let you ftp the feed file up. It has an online form to upload it ?

 

 

Hi Dave,

 

 

Would you mind posting your shopping.com feed code? so we can woke on it together.

 

 

Thanks

 

sean

Link to comment
Share on other sites

it's possible, i've done it before for shopping.com... you can set it up for pick up i believe instead of ftp (or maybe it was ftp). it's automated on my client's systems.

 

i'll try to repost and get the froogle data feeder contribution verified by the moderators this week.

 

Would anyone be able to point me to where I can get a copy of this in the mean time?

Link to comment
Share on other sites

Below is the code form my /admin/shopping.com.php file, caveat is that it is hard coded for some of my categories in this section of code:-

 

$output .= "\t" . $row->mfgName . "\t" . $row->prodModel . "\t" . 
preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" .
preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" .
$row->price . "\t" .
$row->product_url . "\t" .
$row->image_url . "\t" .
// $catIndex[$row->prodCatID] . "\t" .
"Home and Garden / Pets" . "\t" .
$prodStatusOut . "\t" .
"Ships 2-3 Days\t" .
// $catIndex[$row->prodCatID] . "\t" .
$lowestShipping . "\t" . // Standard Shipping ????
$row->products_weight;
// $row->id;

 

 

<?php
//  Start TIMER
//  -----------
$stimer = explode( ' ', microtime() );
$stimer = $stimer[1] + $stimer[0];
//  -----------


$OutFile = "../feeds/furbabies_shopping.csv"; //"CHANGEME-full-path-to-file-with-777-dir-and-file-permissions.fr-outfile.txt";
$destination_file = "furbabies_shopping.csv";  //"CHANGEME-filename-to-upload-to-froogle.txt";
$source_file = $OutFile;
$imageURL = 'http://www.furbabies.co.uk/images/';
$productURL = 'http://www.furbabies.co.uk/product_info.php?products_id=';
$already_sent = array();

$home = "";
$user="";
$pass="";
$base="";

$ftp_server = "hedwig.google.com";
$ftp_user_name = "";
$ftp_user_pass = "";
$ftp_directory = ""; // leave blank for froogle

$taxRate = 0; //default = 0 (e.g. for 17.5% tax use "$taxRate = 17.5;")
$taxCalc = ($taxRate/100) + 1;  //Do not edit
$convertCur = false; //default = false
$curType = "GBP"; // Converts Currency to any defined currency (eg. USD, EUR, GBP)
if($convertCur)
{
$productURL = "http://www.furbabies.co.uk/product_info.php?currency=" . $curType . "&products_id=";  //where CURTYPE is your currency type (eg. USD, EUR, GBP)
}

//START Advance Optional Values

//(0=False 1=True) (optional_sec must be enabled to use any options)
$optional_sec = 0;
$instock = 0;
$shipping = 0;
$lowestShipping = "1.50";  //this is not binary.
$brand = 0;
$upc = 0;   //Not supported by default osC
$manufacturer_id = 0;  //Not supported by default osC
$product_type = 0;
$currency = 0;
$default_currency = "GBP";  //this is not binary.
$feed_language = 0;
$default_feed_language = "en";  //this is not binary.
$ship_to = 0;
$default_ship_to = "ALL"; //this is not binary, not supported by default osC for individual products.
$ship_from = 0;
$default_ship_from = "GBP"; //this is not binary, not supported by default osC for individual products.

//END of Advance Optional Values

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_model AS prodModel, products_weight,
manufacturers.manufacturers_name AS mfgName,
manufacturers.manufacturers_id,
products.products_id AS id,
products_description.products_name AS name,
products_description.products_description AS description,
products.products_quantity AS quantity,
products.products_status AS prodStatus,
FORMAT( IFNULL(specials.specials_new_products_price, products.products_price) * " . $taxCalc . ",2) AS price,
CONCAT( '" . $imageURL . "' ,products.products_image) AS image_url,
products_to_categories.categories_id AS prodCatID,
categories.parent_id AS catParentID,
categories_description.categories_name AS catName
FROM categories,
categories_description,
products,
products_description,
products_to_categories

left join manufacturers on ( manufacturers.manufacturers_id = products.manufacturers_id )
left join specials on ( specials.products_id = products.products_id AND ( ( (specials.expires_date > CURRENT_DATE) OR (specials.expires_date = 0) ) AND ( specials.status = 1 ) ) )

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 categories.categories_id=categories_description.categories_id
ORDER BY
products.products_id ASC
";


$catInfo = "
SELECT
categories.categories_id AS curCatID,
categories.parent_id AS parentCatID,
categories_description.categories_name AS catName
FROM
categories,
categories_description
WHERE categories.categories_id = categories_description.categories_id
";

function findCat($curID, $catTempPar, $catTempDes, $catIndex)
{
if( (isset($catTempPar[$curID])) && ($catTempPar[$curID] != 0) )
{
	if(isset($catIndex[$catTempPar[$curID]]))
	{
		$temp=$catIndex[$catTempPar[$curID]];
	}
	else
	{
		$catIndex = findCat($catTempPar[$curID], $catTempPar, $catTempDes, $catIndex);
		$temp = $catIndex[$catTempPar[$curID]];
	}
}
if( (isset($catTempPar[$curID])) && (isset($catTempDes[$curID])) && ($catTempPar[$curID] == 0) )
{
	$catIndex[$curID] = $catTempDes[$curID];
}
else
{
	$catIndex[$curID] = $temp . " > " . $catTempDes[$curID];
}
return $catIndex;

}

$catIndex = array();
$catTempDes = array();
$catTempPar = array();
$processCat = mysql_query( $catInfo )or die( $FunctionName . ": SQL error " . mysql_error() . "| catInfo = " . htmlentities($catInfo) );
while ( $catRow = mysql_fetch_object( $processCat ) )
{
$catKey = $catRow->curCatID;
$catName = $catRow->catName;
$catParID = $catRow->parentCatID;
if($catName != "")
{
	$catTempDes[$catKey]=$catName;
	$catTempPar[$catKey]=$catParID;
}
}

foreach($catTempDes as $curID=>$des)  //don't need the $des
{
$catIndex = findCat($curID, $catTempPar, $catTempDes, $catIndex);
}

$_strip_search = array(
"![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars
'%[\r\n]+%m'); // remove CRs and newlines
$_strip_replace = array(
'',
' ');
$_cleaner_array = array(">" => "> ", "?" => "", "?" => "", "?" => "", "?" => "", "\t" => "", "	" => "");

if ( file_exists( $OutFile ) )
unlink( $OutFile );

//$output = "product_url \t name \t description \t price \t image_url \t category \t offer_id";
$output = "MPN\t Manufacturer Name\t UPC\t Product Name\t Product Description \t Product Price \t Product URL\t Image URL \t Dealtime.co.uk Categorisation\t Stock Availability\t Stock Description\t Standard Shipping\t Weight";
//create optional section
if($optional_sec == 1)
{
if($instock == 1)
	$output .= "\t instock ";
if($shipping == 1)
	$output .= "\t shipping ";
if($brand == 1)
	$output .= "\t brand ";
if($upc == 1)
	$output .= "\t upc ";
if($manufacturer_id == 1)
	$output .= "\t manufacturer_id ";
if($product_type == 1)
	$output .= "\t product_type ";
if($currency == 1)
	$output .= "\t currency ";
if($feed_language == 1)
	$output .= "\t language ";
if($ship_to == 1)
	$output .= "\t ship_to ";
if($ship_from == 1)
	$output .= "\t ship_from ";
}
$output .= "\n";


$result=mysql_query( $sql )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql = " . htmlentities($sql) );

//Currency Information
if($convertCur)
{
$sql3 = "
SELECT
currencies.value AS curUSD
FROM
currencies
WHERE currencies.code = '$curType'
";

$result3=mysql_query( $sql3 )or die( $FunctionName . ": SQL error " . mysql_error() . "| sql3 = " . htmlentities($sql3) );
$row3 = mysql_fetch_object( $result3 );
}

$loop_counter = 0;

while( $row = mysql_fetch_object( $result ) )
{
if (isset($already_sent[$row->id])) continue; // if we've sent this one, skip the rest of the while loop

if( $row->prodStatus == 1 || ($optional_sec == 1 && $instock == 1) )
{

	if($convertCur)
	{
		$row->price = ereg_replace("[^.0-9]", "", $row->price);
		$row->price = $row->price *  $row3->curUSD;
		$row->price = number_format($row->price, 2, '.', ',');
	}
	if($row->prodStatus == 1)
	{
		$prodStatusOut = "Y";
	}
	else
	{
		$prodStatusOut = "N";
	}
	$output .= "\t" . $row->mfgName . "\t" . $row->prodModel . "\t" . 
	preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->name, $_cleaner_array) ) ) . "\t" .
	preg_replace($_strip_search, $_strip_replace, strip_tags( strtr($row->description, $_cleaner_array) ) ) . "\t" .
	$row->price . "\t" .
	$row->product_url . "\t" .
	$row->image_url . "\t" .
//		$catIndex[$row->prodCatID] . "\t" .
	"Home and Garden / Pets" . "\t" .
	$prodStatusOut . "\t" .
	"Ships 2-3 Days\t" .
//		$catIndex[$row->prodCatID] . "\t" .
	$lowestShipping . "\t" . // Standard Shipping ????
	$row->products_weight;
//		$row->id;

//optional values section
if($optional_sec == 1)
{
	if($instock == 1)
	{
		if($row->prodStatus == 1)
		{
			$prodStatusOut = "Y";
		}
		else
		{
			$prodStatusOut = "N";
		}
		$output .= " \t " . $prodStatusOut;
	}
	if($shipping == 1)
		$output .= " \t " . $lowestShipping;
	if($brand == 1)
		$output .= " \t " . $row->mfgName;
	if($upc == 1)
		$output .= " \t " . "Not Supported";
	if($manufacturer_id == 1)
		$output .= " \t " . "Not Supported";
	if($product_type == 1)
	{
		$catNameTemp = strtolower($catName);
		if($catNameTemp == "books")
			$productTypeOut = "book";
		else if($catNameTemp == "music")
			$productTypeOut = "music";
		else if($catNameTemp == "videos")
			$productTypeOut = "video";
		else
			$productTypeOut = "other";

		$output .= " \t " . $productTypeOut;
	}
	if($currency == 1)
		$output .= " \t " . $default_currency;
	if($feed_language == 1)
		$output .= " \t " . $default_feed_language;
	if($ship_to == 1)
		$output .= " \t " . $default_ship_to;
	if($ship_from == 1)
		$output .= " \t " . $default_ship_from;
}
$output .= " \n";
}
$already_sent[$row->id] = 1;


$loop_counter++;
if ($loop_counter>750) {
$fp = fopen( $OutFile , "a" );
$fout = fwrite( $fp , $output );
fclose( $fp );
$loop_counter = 0;
$output = "";
}
}

$fp = fopen( $OutFile , "a" );
$fout = fwrite( $fp , $output );
fclose( $fp );
echo "File completed: <a href=\"" . $OutFile . "\" target=\"_blank\">" . $destination_file . "</a><br>\n";
chmod($OutFile, 0777);

/*
//Start FTP to Froogle

function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile )
{
// set up basic connection
$conn_id = ftp_connect($ftpservername);
if ( $conn_id == false )
{
echo "FTP open connection failed to $ftpservername <BR>\n";
return false;
}

// login with username and password
$login_result = ftp_login($conn_id, $ftpusername, $ftppassword);

// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!<BR>\n";
echo "Attempted to connect to " . $ftpservername . " for user " . $ftpusername . "<BR>\n";
return false;
} else {
echo "Connected to " . $ftpservername . ", for user " . $ftpusername . "<BR>\n";
}

if ( strlen( $ftpdirectory ) > 0 )
{
if (ftp_chdir($conn_id, $ftpdirectory )) {
echo "Current directory is now: " . ftp_pwd($conn_id) . "<BR>\n";
} else {
echo "Couldn't change directory on $ftpservername<BR>\n";
return false;
}
}

ftp_pasv ( $conn_id, true );
// upload the file
$upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII );

// check upload status
if (!$upload) {
echo "$ftpservername: FTP upload has failed!<BR>\n";
return false;
} else {
echo "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile . "<BR>\n";
}

// close the FTP stream
ftp_close($conn_id);

return true;
}

ftp_file( $ftp_server, $ftp_user_name, $ftp_user_pass, $source_file, $ftp_directory, $destination_file);

//End FTP to Froogle
*/
//  End TIMER
//  ---------
$etimer = explode( ' ', microtime() );
$etimer = $etimer[1] + $etimer[0];
echo '<p style="margin:auto; text-align:center">';
printf( "Script timer: <b>%f</b> seconds.", ($etimer-$stimer) );
echo '</p>';
//  ---------

?>

 

This does work, but needs tweaking still

 

I still want some way of automating it to be uploaded/grabbed on a daily basis though, any ideas ?

Link to comment
Share on other sites

Getting this error after upload:

 

Warning: mysql_connect(): Access denied for user: 'wkd2com_osc1@localhost' (Using password: YES) in /home/wkd2com/public_html/wholesale/admin/froogle.php on line 62

Error when connecting itself to the data base

Link to comment
Share on other sites

Finally got this downloaded from the Contribs section :)

 

It looks good, but I need to know how to do the following: -

  • Remove the "offer_id" column from the output file.
  • Have only the last category listed (i.e. instead of DVD Movies > Cartoons, just have Cartoons)
  • Include manufacturers_id (Model numbers). There's a note "Not supported by default osC" - what do I have to do?

Thanks.

 

Marc.

Link to comment
Share on other sites

It looks good, but I need to know how to do the following: -
  • Remove the "offer_id" column from the output file.
  • Have only the last category listed (i.e. instead of DVD Movies > Cartoons, just have Cartoons)
  • Include manufacturers_id (Model numbers). There's a note "Not supported by default osC" - what do I have to do?

 

Oops, just had a read of Froogle rules, and it seems offer_id is a required field, so I don't mind keeping it! I'd still like to know how to do the other two, though :)

Link to comment
Share on other sites

Froogle Data Feeder v1.62d

Released By: Calvin K

------------------------

 

Date: December 21, 2005

 

Description: Creates and automatically sends a data feed to Froogle, to provide product information and pictures. This Froogle Data Feeder, handles product duplicates, specials(if available), currency conversion, tax support, html descriptions, full category trees, and automatic upload. In addition, the Froogle Data Feeder supports advance feeds. With the advance feed option enabled and the "instock" field enabled, it will create a feed with all of the products. Without the advance feed option enabled, it will only submit in stock items.

 

http://www.oscommerce.com/community/contributions,3876

 

Stable Release. Readme Update Only.

Edited by Vger

Most likely your question has been answered, please do a search first.

Link to comment
Share on other sites

Thanks for this great contrib.

 

Just one thing : It doesn't manage multi-language stores.

 

I had to add a couple of lines in the queries:

"AND products_description.language_id=4"

 

"AND categories_description.language_id=4"

 

It divided the query time by four! (we use 4 different languages in our store)

 

There must be a better way to do this

Link to comment
Share on other sites

Hi everyone I am not sure if this has been answered already I cant handle reading 71 pages of posts.

I am getting this when I run froogle.php

: SQL error Unknown column 'products.manufacturers_id' in 'on clause'| sql = SELECT concat( 'http://www.backpackersoutlet.com/product_info.php?products_id=' ,products.products_id) AS product_url, products_model AS prodModel, products_weight, manufacturers.manufacturers_name AS mfgName, manufacturers.manufacturers_id, products.products_id AS id, products_description.products_name AS name, products_description.products_description AS description, products.products_quantity AS quantity, products.products_status AS prodStatus, FORMAT( IFNULL(specials.specials_new_products_price, products.products_price) * 1,2) AS price, CONCAT( 'http://www.backpackersoutlet.com/images/' ,products.products_image) AS image_url, products_to_categories.categories_id AS prodCatID, categories.parent_id AS catParentID, categories_description.categories_name AS catName FROM categories, categories_description, products, products_description, products_to_categories left join manufacturers on ( manufacturers.manufacturers_id = products.manufacturers_id ) left join specials on ( specials.products_id = products.products_id AND ( ( (specials.expires_date > CURRENT_DATE) OR (specials.expires_date = 0) ) AND ( specials.status = 1 ) ) ) 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 categories.categories_id=categories_description.categories_id ORDER BY products.products_id ASC

 

 

Right now the only contribs I am running are Ultimate SEO and cDynamic Meta Tags.

 

Thanks

Link to comment
Share on other sites

This should be quick, I'm having a hard time getting the script to recognize my database, this is the information I have about the database name:

 

Users in osc1

demandb_osc1 (Privileges: ALL PRIVILEGES)

 

Connection Strings

Perl $dbh = DBI->connect("DBI:mysql:demandb_osc1:localhost","demandb_osc1","<PASSWORD HERE>");

PHP $dbh=mysql_connect ("localhost", "demandb_osc1", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());

mysql_select_db ("demandb_osc1");

 

This is what I have in my script:

 

$base="demandb_osc1";

Link to comment
Share on other sites

Hello, is there a Google Base Contribution or is there anyone planning to develop it? i know there is the froogle contribution and it would look the same, and this would look good too

 

heres the link: http://www.google.com/base/

thanks

 

The Froogle Data Feeder is easily adapted to handle Google Base... different server, different headers, but otherwise they are pretty much the same.

 

Change this line....

 

$ftp_server = "hedwig.google.com";

...to...

 

$ftp_server = "uploads.google.com";

 

 

...and this....

 

$output = "product_url \t name \t description \t price \t image_url \t category \t offer_id";

...to...

 

$output = "link \t title \t description \t price \t image_link \t category \t offer_id";

 

 

:)

Link to comment
Share on other sites

Yes, just rename the amended version base_google.php, upload it to your admin directory alongside froogle.php, and the two will happily co-exist.

 

I have my cron jobs set an hour apart, and the two feeds have slightly different names, because both Froogle and Base have been having problems with ftp on occasion... this way I can see right away if one or other feed fails, and upload the feed manually.

 

I also added base to the admin panel, so I can generate additional feeds. If you need any further info, feel free to drop me a PM.

 

:)

 

Maggi

Link to comment
Share on other sites

Hello,

 

What is the status of the FTP issue. Everything works fine except I get FTP errors.

 

FTP connection has failed!

Attempted to connect to hedwig.google.com for user **********

Link to comment
Share on other sites

I've not had any problems with ftp this past ten days or so... cron jobs and additional feeds to both Froogle and Base have all uploaded successfully.

 

You might want to check your configuration... that error message seems to suggest the connection is opening, but failing at the login...

 

:)

Edited by Maggilove
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...