Scheduled saving of Web page?

D

dtronvig

I'd like to automatically save, every day, a copy of a Web page which
shows the daily schedule for an Internet stream. The title of the page
includes the date, so there could be a unique file name generated from
that, or from the date when the page is saved.

Is there software that will do that? Free would be great, but cheap
would be fine.

Thanks,
Drew
 
A

Adam Piggott

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'd like to automatically save, every day, a copy of a Web page which
shows the daily schedule for an Internet stream. The title of the page
includes the date, so there could be a unique file name generated from
that, or from the date when the page is saved.

Is there software that will do that? Free would be great, but cheap
would be fine.

You can use cURL[1] as a scriptable/scheduleable program to download the
web page, but I can't think of a way of naming it the way you want without
a bit of jiggery-pokery.

If you donated a couple of dollars to a worthy charity I could do this for
you if you let me know the URL of the site. Or you could just sucker me and
I'd never know, but then I'd find you in another life :p


[1] http://curl.haxx.se/

HTH

Adam Piggott, Proprietor, Proactive Services (Computing).
http://www.proactiveservices.co.uk/

Please replace dot invalid with dot uk to email me.
Apply personally for PGP public key.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFDzsPD7uRVdtPsXDkRAlvoAJ4pBDy6f8IWuyDaTY6I07JAvGXEFACfcjRN
/CtxMlYPr3UFQu9QScmw3q8=
=5JEA
-----END PGP SIGNATURE-----
 
D

dtronvig

Thanks Adam. I'll see if I can pass a DOS-generated date as a parameter
to be appended to a base file name.

Thanks,
Drew
 
D

dtronvig

Hey Adam,

I worked it out. It did take some jiggery-pokery, but all in DOS.
Here's the batch file:

FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET
dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET date=%mm%-%dd%-%yyyy%
"C:\Program Files\curl\curl" -o Radio_Bartok\Playlist_%date%.htm
http://mronline.radio.hu/BARTOK.HTM

The first four lines I got from
http://www.tech-recipes.com/computer_programming_tips956.html. I only
vaguely understand how they work, but they give you variables for
month, day and year, which you can string together however you like. In
this case I set up a date string so I end up with an output file
Playlist_01-18-2006.htm, or whatever.

By the way, don't go streaming Radio Bartok and taking up one of the 50
slots. You wouldn't like it.

Thanks very much,
Drew
 
D

David

Hey Adam,

I worked it out. It did take some jiggery-pokery, but all in DOS.
Here's the batch file:

FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET
dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET date=%mm%-%dd%-%yyyy%

I would change that to:

SET date=%yyyy%-%mm%-%dd%

in order to correctly sort in date order in all operating systems.
--
David
Remove "farook" to reply
At the bottom of the application where it says
"sign here". I put "Sagittarius"
E-mail: justdas at iinet dot net dot au
 
A

Adam Piggott

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey Adam,

I worked it out. It did take some jiggery-pokery, but all in DOS.
Here's the batch file:

FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET
dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET date=%mm%-%dd%-%yyyy%
"C:\Program Files\curl\curl" -o Radio_Bartok\Playlist_%date%.htm
http://mronline.radio.hu/BARTOK.HTM

The first four lines I got from
http://www.tech-recipes.com/computer_programming_tips956.html. I only
vaguely understand how they work, but they give you variables for
month, day and year, which you can string together however you like. In
this case I set up a date string so I end up with an output file
Playlist_01-18-2006.htm, or whatever.

You know, I keep on meaning to sit down and play with TOKENS but haven't
got round to it yet. I'd have written a JavaScript program to download and
save the file with cURL and name it using the JavaScript date functions.
Most of my batch files seem to go the JS way these days :)
You might want to include the -f flag in cURL, otherwise is there's a 404
cURL will save the 404 page into the file!


By the way, don't go streaming Radio Bartok and taking up one of the 50
slots. You wouldn't like it.

BBC Radio 1 here usually :p
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFDz3bi7uRVdtPsXDkRAvQBAKCUwZHjQW7vgXIGoilYIbjPUthLfQCfd5tE
i7ooff7Wnbwcb/Rd3bV/YYo=
=j8b4
-----END PGP SIGNATURE-----
 
D

dtronvig

Hi Adam,

This would be an -f flag as opposed to an -F flag? Is there a
comprehensive list of flags for cURL somewhere?

Thanks,
Drew
 
A

Adam Piggott

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Adam,

This would be an -f flag as opposed to an -F flag? Is there a
comprehensive list of flags for cURL somewhere?

- -f = --fail: Fail silently (no output at all) on HTTP errors
- -F = --form: Specify HTTP multipart POST data

There's a short version of the help via -h, or a full manual via --manual.
Also you should find a "docs" folder with the manual in it as well. RTFM ;-)

If you have any problems using it let me know, I've got a bit of experience
with cURL over the years.


Cheers
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)

iD8DBQFDz+jA7uRVdtPsXDkRAoY3AKCORKud6fshtua14AtZs9ndEWyGMACeLQbp
uWgEZ/n8mMWDlpaCzG0DFns=
=DqN6
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top