Forum Moderators: phranque
I have a site I am artnering with another site.... they are going to give me a news feed via a text file at
http ://www.theirdomain.com/news.txt
I can take this text file, and put it inside a templete and spit it out- not a problem. The problem comes in how do I get the file from their site to mine?
I first just figured I would do a cron job
ftp http ://www.theirdomain.com/news.txt /my/site/news.txt
But they do not accept anonymous ftp. I can have this file put in a web-accessable area, so I figured I could do some sort of http grab. I am just not sure how. I am thinking lib_www would do this, right?
I need to grab their page- and ONLY one, specific file!- and save it under a new name on my server. What is the best way to accomplish this?
Thanks!
Dave
OK, I used wget from the command line, and it worked fine. I used this command:
wget [theirsite...] --output-document /path/to/my/test.txt
As a command line in telnet, it works great. But when run as a cron job (which is my goal!), I get this error:
wget: not found
Not sure why- anyone got any ideas?
Should I put this in s script, and then cron the script? If I do that, I would like to run a check to make sure the file is not zero bytes, how can I do that?
I think what I would like to do, if I run a script, is run the ewget, check and make sure it is not zero bytes, and if it is not, then copy test.txt to news.txt (which is the actual file I use for the include.) Does this sound good?
Thanks!
Dave