Jump to content
gottaloveit

Automatically send data feed to Froogle

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.

Share this post


Link to post
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


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Update: Got the PriceGrabber Feed Specs

Shopping.com requires a min of $99 deposit.... I'll have to see if one of my clients want this. unless someone out there has the feed specs and wants to share. =(


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

Share this post


Link to post
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

John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
Share on other sites

I dont know whether cron is listed within my php script or not. I dont have ability to set cron jobs myself....had to ask host.

Edited by dumb_question

Share this post


Link to post
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?

Share this post


Link to post
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?


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
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.

Share this post


Link to post
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.


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
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 );

Share this post


Link to post
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

Share this post


Link to post
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.


John Oligario

 

Knowledge Base Contributions

Share this post


Link to post
Share on other sites

The server API is Apache.

 

My host wont allow access to cron jobs. They however, set it up for me.( So i was told).

 

I did, however, uploaded the file to froogle manually.

 

I guess i will have to wait and watch.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×