Forum Moderators: phranque

Message Too Old, No Replies

Getting Content From Another Site

Yes, with permission!

         

carfac

4:24 pm on Apr 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi:

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

EliteWeb

4:29 pm on Apr 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



wget the file instead of ftp :)

carfac

5:24 pm on Apr 17, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks! I will read the man file and figure it out!

I KNEW there would be a way!

dave

carfac

3:02 pm on Apr 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi:

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