Please advise on directions 
Author Message
 Please advise on directions

Good day!
I'm writing application in Perl. One of the things it does is it retrieves
index.html from a certain website reads it, gets news headlines and saves
them formatted as multidimensional array in news.js file, so that The
JavaScript would use it for dynamic headline updates. My question is where
should I look and what should I read to make the proggy go and retrieve this
page every 1 hour. lets say. Sockets, TCP/IP or this is not where I should
look?

Thanks in advance

Mike



Sun, 21 Mar 2004 06:34:01 GMT  
 Please advise on directions

Quote:

> Good day!
> I'm writing application in Perl. One of the things it does is it
> retrieves
> index.html from a certain website reads it, gets news headlines and saves
> them formatted as multidimensional array in news.js file, so that The
> JavaScript would use it for dynamic headline updates. My question is
> where
> should I look and what should I read to make the proggy go and retrieve
> this
> page every 1 hour. lets say. Sockets, TCP/IP or this is not where I
> should
> look?

if i understand your question, it seems that you already have the hard
part done. if you're on a *nix system, i.e., one with a cron daemon
running, just set the crontab to have the script called every hour, and
have the script create a new news.js file it the proper dir each time.
i'd call the new file 'news.js.new', then rename it to 'news.js'. that
way, any process asking for 'news.js' will be much less likely to get a
half-built version.

hth-
--



Sun, 21 Mar 2004 07:56:16 GMT  
 Please advise on directions
 [snip]

Quote:
>should I look and what should I read to make the proggy go and retrieve this
>page every 1 hour. lets say. Sockets, TCP/IP or this is not where I should
>look?

For retrieving the page, use LWP.  Or, alternatively, use an external
program like wget or lynx.  The *last* thing you want to do is code your
own HTTP client from scratch.

  http://search.cpan.org/search?dist=libwww-perl

For repeating the process every hour, others have already suggested
cron.  If you're not using some Unix variant, your OS probably has some
other comparable scheduling tool you can use.

--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post something,
we discuss its implications.  If the discussion happens to answer a question
you've asked, that's incidental."           -- nobull in comp.lang.perl.misc



Sun, 21 Mar 2004 19:56:09 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Please advise on directions

2. Beginners question - directions please...

3. Please Point me in the right direction

4. Please help me with some direction

5. Parsing Logs...Please Advise

6. perl5 socket error (works with perl4) advise please?

7. advise please with input buffering and flock problem

8. Need Perl programming -- please advise...

9. Serial Port Please Help, be Advised

10. Newbie tempted to use perl - please advise

11. Please advise!

12. Please advise. Fastest way to line-count files

 

 
Powered by phpBB® Forum Software