Downloading a text file from the web using jscript.

Posted by Suf on Sun 27 Jul 2003 03:56 PM — 2 posts, 14,205 views.

#0
I was hoping someone might have some suggestions for me. I want to download a text file from a URL to later parse for highlighting. I was able to download the file using perlscript, but I would much prefer to write the rest of the script in jscript.

As a work around I could download the file using a perlscript plugin and then do the remainder with a jscript plugin referring to the downloaded file.

Here's what I'm doing in perlscript at the moment:


sub downloadHighlights
{
	use LWP::Simple;
	use LWP::Debug qw(+);
	$doc = get 'http://203.194.240.137/elay/evils.txt';  

	$world->note ($doc);

	my $path = $world->GetInfo (60);
	$path = $path . "highlights.txt";

	open(EVILS,">".$path);
	print EVILS $doc;
	close(EVILS);
}


Thanks in advance for any advice.

Suf
Australia Forum Administrator #1
You could use "CallPlugin" to simply pass the data to another plugin written in a different language. Then it would not need to be saved to disk. The downloaded data could be the string passed to the other plugin.

See:


http://www.gammon.com.au/scripts/doc.php?function=CallPlugin