Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Automatically send data feed to Froogle


gottaloveit

Recommended Posts

First of all I have no knowledge of PHP. i tried to make changes as suggested. however, i dont seem to get anywhere:

 

I have may froogle file in temp/feeds/froogle.text( did change the name). I chomoded the folder and file to 777.

 

Here is the code from froogle.php that needed to be changed.

 

$OutFile = "/public_html/temp/feeds/*.txt";

$destination_file = "*.txt";

$source_file = $OutFile;

$imageURL = 'http://www.mywebsite.com/images/thumbs/';

$productURL = 'http://www.mywebsite.com/product_info.php?products_id=';

$already_sent = array();

 

 

ftp portion

 

upload the file

$upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);

 

check upload status

if (!$upload) {

echo "FTP upload has <b>FAILED!</b> source: $source_file dest: $destination_file<BR>";

} else {

echo "Uploaded $source_file to $ftp_server as $destination_file<BR>";

}

 

close the FTP stream

ftp_close($conn_id);

 

0 4 * * 3 /usr/bin/php -q/public_html/admin/froogle.php

End FTP to Froogle

?>

 

**************************************

 

i had to ask the host to set the cron job. When I opened " froogle.txt", it was totally blank.

 

 

I would much appreciate your help.

Link to comment
Share on other sites

you need to read the instructions again on this:

 

 

$OutFile = "/public_html/temp/feeds/*.txt";

$destination_file = "*.txt";

 

you dont have any file names there

Link to comment
Share on other sites

Shopping Comparison Search Engines!

 

Current Status: In Progress, of componentizing.

 

Amazon: Feed API Found

BizRate: Completed

Froogle: Completed

MySimon: Feed API Needed

PriceGrabber: Feed API Needed

Shopping.com: Feed API Needed

Yahoo.com: Completed

 

Any help in locating the Feed API's is much appreciated. Please let me know if there are others out there.

Edited by FlyingMonkey

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

Link to comment
Share on other sites

remove the cron job. run the froogle program manually.

do you get your txt file there?

 

also, you need to tell us if you have the cron listed within your php script or not.

 

it does not belong there, only in your crontab file.

 

0 4 * * 3 /usr/bin/php -q /home/<unix route to your file>/admin/froogle.php

Edited by Mibble
Link to comment
Share on other sites

I'm having a problem getting started. I have edited the froogle.php file as directed, but it's not connecting to the database. I get the error "Error when connecting itself to the data base"

 

The relevent settings are:

 

$home = "localhost" ;

$user="myusername";

$pass="mypassword";

$base="mydatabasename"; (this is the same as my username)

 

I know all of the above is entered correctly, so...what's going on?

Link to comment
Share on other sites

your txt file needs to be named the way froogle gives you as a file name else you will have to do renaming each time you download the froogle. are you able to run the froogle.php file and get something generated?

Link to comment
Share on other sites

i named it the way froogle asked me to. I am not getting anything generated. When you say" are you able to run the froogle.php file "....what exactly do you mean by that. All I did was that i installed froogle.php in /admin.

 

I believe i dont have to make the txt file....froogle should generate it?

 

Appreciate you help.

Link to comment
Share on other sites

in order to generate the froogle file, YOU have to run the program, it will not do it on its own, until the cron is done. we can not do the cron until we find out if it works manually! if it doesnt work manually then it must be fixed.

as above in one of my posts here,

 

you get to http://www.domain.com/admin/froogle.php and if installed properly you will generate the txt file.

Link to comment
Share on other sites

Ok....Thanks for that explanation...that really helped. I ran the file and I get this error

 

Warning: fopen(/temp/feeds/storename.txt): failed to open stream: No such file or directory in/public_html/admin/froogle.php on line 204

 

Warning: fwrite(): supplied argument is not a valid stream resource in /public_html/admin/froogle.php on line 205

 

Warning: fclose(): supplied argument is not a valid stream resource in /public_html/admin/froogle.php on line 206

 

The corresponding 204-206 lines are:

$fp = fopen( $OutFile , "w" );

$fout = fwrite( $fp , $output );

fclose( $fp );

Link to comment
Share on other sites

Actually it was the wrong path....for google.php.

 

I initially put it as /public_html/temp/feeds/storename.txt.. then I changed it to /home/host-provided name/public_html/temp/feeds/ativasativa.txt

 

This worked ..and I ftped file to froogle.

 

The last this I am going to ask you John is look at the following and is if I removed the comments correctly:

 

//Start FTP to Froogle

 

// 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 <b>FAILED!</b> source: $source_file dest: $destination_file<BR>";

} else {

echo "Uploaded $source_file to $ftp_server as $destination_file<BR>";

}

 

// close the FTP stream

ftp_close($conn_id);

 

//End FTP to Froogle

 

 

Finally...thanks a lot , John. appreciate your help

Link to comment
Share on other sites

A lesson on how to use CRON . .

 

You will need to find out the answer to the following question, "Is my PHP installed as CGI or as an Apache module?". To find out do the following: in admin click on tools then server info.

 

Now check for Server API (4th item from the top), if it says "CGI", you have PHP compiled as CGI, if it reads "Apache", you have it running as an Apache module.

Compiled CGI

 

If the answer to the question above is "CGI" then you need to add a line to your PHP script. It has to be the first line of your script and must contain your server's PHP executable location:

 

#!/usr/local/bin/php -q

 

That looks a lot like PERL now, doesn't it? After that let's add the necessary command to our crontab. Edit /etc/crontab and add the following line:

 

* * * * * php /path/to/your/cron.php

 

Execute the following from the command line:

 

Shell> crontab crontab

 

Be sure your "script.php" has the necessary permissions to be executable ("chmod 755 script.php").

 

Now you are all set!

 

Apache module

If your PHP is installed using the Apache module, the approach is a little different. First, you need access to Lynx. Lynx is a small web browser, generally available on Unix and Linux.

 

Running your PHP script will not require you to add any additional lines. You simply have to edit your /etc/crontab file and add the following line:

 

* * * * * lynx -dump http://www.somedomain.com/cron.php

 

Please note that in general, you have to specify the entire URL (with "http://" and so on). But depending on your Lynx's configuration, the URL might be relative; I suggest always using the absolute reference as in my example above - it always works.

 

Again execute the following from the command line:

 

Shell> crontab crontab

 

That all it takes to get a cron job setup using PHP. Hope you have learned something new and will use it to save overhead time on the server and on the developer.

Link to comment
Share on other sites

A lesson on how to use CRON . .

 

You will need to find out the answer to the following question, "Is my PHP installed as CGI or as an Apache module?". To find out do the following: in admin click on tools then server info.

 

Now check for Server API (4th item from the top), if it says "CGI", you have PHP compiled as CGI, if it reads "Apache", you have it running as an Apache module.

Compiled CGI

 

If the answer to the question above is "CGI" then you need to add a line to your PHP script. It has to be the first line of your script and must contain your server's PHP executable location:

 

#!/usr/local/bin/php -q

 

That looks a lot like PERL now, doesn't it? After that let's add the necessary command to our crontab. Edit /etc/crontab and add the following line:

 

* * * * * php /path/to/your/cron.php

 

Execute the following from the command line:

 

Shell> crontab crontab

 

Be sure your "script.php" has the necessary permissions to be executable ("chmod 755 script.php").

 

Now you are all set!

 

Apache module

If your PHP is installed using the Apache module, the approach is a little different. First, you need access to Lynx. Lynx is a small web browser, generally available on Unix and Linux.

 

Running your PHP script will not require you to add any additional lines. You simply have to edit your /etc/crontab file and add the following line:

 

* * * * * lynx -dump http://www.somedomain.com/cron.php

 

Please note that in general, you have to specify the entire URL (with "http://" and so on). But depending on your Lynx's configuration, the URL might be relative; I suggest always using the absolute reference as in my example above - it always works.

 

Again execute the following from the command line:

 

Shell> crontab crontab

 

That all it takes to get a cron job setup using PHP. Hope you have learned something new and will use it to save overhead time on the server and on the developer.

Nice Work, John! :D

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

Link to comment
Share on other sites

I was wondering if anyone has managed to get the attribute price to pull. Currently I have quite a few products that are pulling 0.00. I can manually change them but it takes a while. Otherwise, it is an excellent contribution.

 

Also, I was wondering if anyone else has had a problem with the product categories being changed by Froogle. I checked on mine about 2 weeks ago and they had changed all of my products to categories that were no where close to what I sent or that were even close to reality. I resent my feed and changed every single item to "home decor" and even many of those have changed. I saw one that's now entitled "Autographs & Writing". Any clues?

 

Thanks,

Laurie

Link to comment
Share on other sites

The price attribute thing is tricky and i'll work on that in a later release. Right now, I am focusing on componentizing the feeder system.

 

Froogle puts your categories into their own, sorta sucks at it at times. Try using better titles, descriptions, etc.

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

Link to comment
Share on other sites

Thanks for the quick reply. I will anxiously await the attribute pricing fix. :)

As far as descriptions go, every page says exactly what the item is. The only thing I sell is tapestry products. And how they can get some of the categories I've seen is absolutely beyond me. Maybe a dart board. lol

Why are so many people worried about category depth when Froogle won't even use the categories to start with? Just curious...

 

Thanks,

Laurie

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...