Home News Forum Articles
  Welcome back Join CF
You are here You are here: Home | Forum | Perodicaly grab/refresh txt file?


You are currently viewing our boards as a guest which gives you limited access to view most of the discussions, articles and other free features. By joining our Virgin Media community you will have full access to all discussions, be able to view and post threads, communicate privately with other members (PM), respond to polls, upload your own images/photos, and access many other special features. Registration is fast, simple and absolutely free so please join our community today.


Welcome to Cable Forum
Go Back   Cable Forum > Computers & IT > Internet Discussion

Perodicaly grab/refresh txt file?
Reply
 
Thread Tools
Old 02-11-2007, 23:13   #1
cf.mega poster
 
dragon's Avatar
 
Join Date: Jan 2004
Posts: 3,346
dragon has reached the bronze age
dragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze age
Perodicaly grab/refresh txt file?

Anyone know Of a php script that can connect via http to a site and download a copy of a text file and display it, but if the original source file is not available display the last copy it was able to successfully download?

Also I'd like it to auto refresh every 30 seconds and show the time that the copy was cached.

Text file is http://dragon2611.dyndns.org/wpc.txt (link may not work, depends if the pc running it is turned on or not) I want it available to http://101st-wolfpack.net/catchup (currently a redirect) I want to cache it since the machine its produced by is my home "server" and I usually turn it off when its not in use.

The clan use the channel for their weekly meeting and sometimes people can't make it or join late so its purpose is for them to catch up on what's happened.
__________________
It's Not a Bug It's a 'Feature'
dragon is offline   Reply With Quote
Old 03-11-2007, 08:29   #2
cf.addict
 
Join Date: Sep 2007
Posts: 248
lsproc is an unknown quantity at this point
Re: Perodicaly grab/refresh txt file?

You can use the php shell command to call a wget if you want.
__________________
Its Lsproc if you cant tell

And I have memorised signal levels, arent I sad
lsproc is offline   Reply With Quote
Old 03-11-2007, 10:04   #3
 
Graham M's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 23
Services: Sky+ V-Box VM 10MBit
Posts: 9,762
Graham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny star
Graham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny star
Send a message via MSN to Graham M Send a message via Yahoo to Graham M
Re: Perodicaly grab/refresh txt file?

PHP you can set to enable http:// includes in the php.ini file if you have access
__________________
Used to be Zeph - I'm still me though
Peter: Oh my god, Brian, there's a message in my Alphabits. It says, 'Oooooo.'
Brian: Peter, those are Cheerios.
www.elitehealthdistribution.co.uk - www.loonyasylum.net
Graham M is offline   Reply With Quote
Old 03-11-2007, 10:14   #4
cf.addict
 
Join Date: Sep 2007
Posts: 248
lsproc is an unknown quantity at this point
Re: Perodicaly grab/refresh txt file?

Quote:
Originally Posted by Zeph View Post
PHP you can set to enable http:// includes in the php.ini file if you have access
Surely that can be done via ini_set anyway...
__________________
Its Lsproc if you cant tell

And I have memorised signal levels, arent I sad
lsproc is offline   Reply With Quote
Old 03-11-2007, 11:32   #5
 
Graham M's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 23
Services: Sky+ V-Box VM 10MBit
Posts: 9,762
Graham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny star
Graham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny star
Send a message via MSN to Graham M Send a message via Yahoo to Graham M
Re: Perodicaly grab/refresh txt file?

Quite possibly, depends on the environment
__________________
Used to be Zeph - I'm still me though
Peter: Oh my god, Brian, there's a message in my Alphabits. It says, 'Oooooo.'
Brian: Peter, those are Cheerios.
www.elitehealthdistribution.co.uk - www.loonyasylum.net
Graham M is offline   Reply With Quote
Old 03-11-2007, 11:32   #6
cf.mega poster
 
dragon's Avatar
 
Join Date: Jan 2004
Posts: 3,346
dragon has reached the bronze age
dragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze age
Re: Perodicaly grab/refresh txt file?

I don't know how to code php, but I know someone who does and he's working on it for me
__________________
It's Not a Bug It's a 'Feature'
dragon is offline   Reply With Quote
Old 03-11-2007, 11:39   #7
 
Graham M's Avatar
 
Join Date: Jul 2003
Location: Poole, Dorset
Age: 23
Services: Sky+ V-Box VM 10MBit
Posts: 9,762
Graham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny star
Graham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny starGraham M has a nice shiny star
Send a message via MSN to Graham M Send a message via Yahoo to Graham M
Re: Perodicaly grab/refresh txt file?

OK why don't you set up a CRON job to periodically grab the file and place it in the web directory, say in your home directory (for root or the web server user) put a file called "getfile.sh" and in it put something like

Code:
#!/bin/sh
cd /var/www/html
wget http://dragon2611.dyndns.org/wpc.txt
Log in as the root/web server user and type "crontab -e" (no quotes), assuming vi opens which is usually default, press i and then move to the last line (if there are any already and add)

5 * * * * ~/getfile.sh > /dev/null 2>&1

then press esc, and type :wq and press enter

then make sure the getfile.sh file is executable by typing chmod +x getfile.sh and Bob's your uncle, assuming everything is OK that file should be updated every hour of every day at five minutes passed.
__________________
Used to be Zeph - I'm still me though
Peter: Oh my god, Brian, there's a message in my Alphabits. It says, 'Oooooo.'
Brian: Peter, those are Cheerios.
www.elitehealthdistribution.co.uk - www.loonyasylum.net
Graham M is offline   Reply With Quote
Old 03-11-2007, 14:50   #8
cf.mega poster
 
dragon's Avatar
 
Join Date: Jan 2004
Posts: 3,346
dragon has reached the bronze age
dragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze agedragon has reached the bronze age
Re: Perodicaly grab/refresh txt file?

---------- Post added at 14:50 ---------- Previous post was at 14:50 ----------

Quote:
Originally Posted by Zeph View Post
OK why don't you set up a CRON job to periodically grab the file and place it in the web directory, say in your home directory (for root or the web server user) put a file called "getfile.sh" and in it put something like

Code:
#!/bin/sh
cd /var/www/html
wget http://dragon2611.dyndns.org/wpc.txt
Log in as the root/web server user and type "crontab -e" (no quotes), assuming vi opens which is usually default, press i and then move to the last line (if there are any already and add)

5 * * * * ~/getfile.sh > /dev/null 2>&1

then press esc, and type :wq and press enter


then make sure the getfile.sh file is executable by typing chmod +x getfile.sh and Bob's your uncle, assuming everything is OK that file should be updated every hour of every day at five minutes passed.

I want it to update as soon as someone calls the page if the server is online.
__________________
It's Not a Bug It's a 'Feature'
dragon is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +1. The time now is 11:59.


Links
Google
 
Web www.cableforum.co.uk


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
Copyright © 2003 - 2008, Cable Forum.
(s204569790.onlinehome.info)