Re: URL Access Scripting
Re: URL Access Scripting
- Subject: Re: URL Access Scripting
- From: Doug McNutt <email@hidden>
- Date: Tue, 23 Jul 2002 16:16:25 -0600
At 16:12 -0500 7/23/02, ken wrote:
>
Is there some way to just load it into a variable in memory instead of writing it to a file first?
Nope.
Well. . . I haven't found one and other attempts to read a typical html file directly into a script fail miserably when the size is more than a few kB. Read with delimiter or until delimiter from a temporary file is an option. System wide disk caching should - one hopes - save time by not actually writing to the disk.
MacPerl, or perl itself in OS neXt, is the answer and it will work when you move your cgi to a major server.
use LWP::Simple; # set up to use LWP lib for get(URL)
$theURL = "http://. . . . ..html;
$content = get($theURL);
if(not defined($content))
{
print "Unable to get $theURL\n";
last;
}
$size = length($content); # Can be over a megabyte without problems.
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.