PDA

View Full Version : automated data feed insertion



MarkB
06-12-2004, 05:12 AM
Hi guys,

Am running, and am also planning, several sites that use a static data feed provided for affiliates.

I'm currently doing the following manually:

- download latest feed (in txt tab-delimited format) using wget
- empty database via phpmyadmin (truncate)
- insert new feed (using a simple php script to parse the txt file into SQL) into the database

Can anyone suggest to me, or show me, how this could be done via cron?

Thanks!
Mark

Chris
06-12-2004, 06:36 AM
shouldn't be too hard (I have to do this myself soon).

cron the wget

make a php script for the database emptying

cron both php scripts

so it's be like

wget whatever
php location of php script
php location of other php script

MarkB
06-12-2004, 07:17 AM
Thanks Chris!

Chris
06-12-2004, 09:21 AM
Can you use wget to get things via FTP?

MarkB
06-12-2004, 09:48 AM
I'm sure I have before (to download server scripts/patches etc). If you need to login to the ftp server, you may need to use something like:

wget ftp://youruser:yourpass@yoursite.com/file.gz

(my syntax is probably messed up, though)

MarkB
06-12-2004, 09:49 AM
On the other hand, try perhaps:

wget --ftp-user=AFFILIATE_ID --ftp-passwd=AFFILIATE_PASSWORD https://www.domain.com/feed.gz

- that may work...

gargonzo
07-09-2004, 11:57 AM
how about a nice tutorial :) on data feeds...

regards
garz

AndyH
07-09-2004, 05:36 PM
Know how to CRON PHP scripts?

MarkB
07-09-2004, 10:57 PM
Do you have CPanel?

AndyH
07-10-2004, 06:16 PM
If that is a question to me, mine was asking you. But I guess you do. :)