Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Jscript
➜ Downloading a text file from the web using jscript.
|
Downloading a text file from the web using jscript.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Suf
(5 posts) Bio
|
| Date
| Sun 27 Jul 2003 03:56 PM (UTC) |
| Message
| 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 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,169 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sun 27 Jul 2003 09:18 PM (UTC) |
| Message
| 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
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,291 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top