?
Solved

script to add schedual content download automatically

Posted on 2005-05-05
4
Medium Priority
?
307 Views
Last Modified: 2010-04-17
dear sir
i want to make a script which take from a text file an address
http://www.yahoo.com
http://www.msn.com
http://www.sms.ac
http://www.cnn.com
etc
and add it to a schedual content download to isa server
any language can do that ?
0
Comment
Question by:xodos
  • 2
4 Comments
 
LVL 25

Expert Comment

by:InteractiveMind
ID: 13934821
> and add it to a schedual content download to isa server.
Excuse my ignorance, but how is this done? Do you know? (..because I don't).

As for the rest of it, a simple Batch script can do this:


@echo off
title URL Schedular

set inputFile=filename.txt

for /f "delims=" %%U in ("%inputFile%") do call :process "%%U"
goto :eof

:process
set line=%~1
:: Schedule the download of the '%line%' variable here.
exit /b

:eof


HTH :-)
Rob.
0
 

Author Comment

by:xodos
ID: 13934995
it will open isa server and add a schedual content download for each line it takes from the text file ,
the script must take a line from the text file and add it as a schedual content download .
look what i want to do :
i have a dns cache only server and isa server on the same computer
in dns server there are many site addresses ,
i want to take the address from the dns and add it to the schedual content download in isa server to be downloaded daily at 1:00 am ,
i can do it manually but there are millions of sites
so a script is very usable here
hope you can help me
thank you very much


0
 
LVL 1

Accepted Solution

by:
srikpen earned 2000 total points
ID: 14003415
--------------------------------snip for getwebpg.pl------------------------------------
#!/usr/bin/perl

## Create a user agent object
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("MyApp/0.1 ");
$ua->proxy('http', "http://www.company.com:80");


#Opens the urlfile.txt to get the URLS.
open(HND, "./urlfile.txt") || die " Can't open file : $!";
chomp(@arr = <HND>);
close(HND);

# print all the URLS content.
my $url;
for$url ( @arr) {
        print "Getting $url =======================================\n";
        print "====================================================\n";
        my $res = $ua->post($url);

        if( $res->is_success ) {
                print $res->content;
        } else {
                print "Unable to get $url\n";
        }

        print "\n";
}
--------------------------------snip------------------------------------


example urlfile.txt for above contains:
----------------------------------snip for urlfile.txt-------------------
http://www.yahoo.com
http://www.book.com
http://www.car.com
http://www.bookpool.com
http://www.monster.com
----------------------------------snip ----------------------------------
0
 
LVL 1

Expert Comment

by:srikpen
ID: 14003419
you can comment
$ua->proxy('http', "http://www.company.com:80");

if you dont' have any proxy in between like:
#   $ua->proxy('http', "http://www.company.com:80");
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question