perl to applescript
perl to applescript
- Subject: perl to applescript
- From: christian sørhaug <email@hidden>
- Date: Sat, 15 Dec 2001 15:44:43 +0100
i have this perl script, and it is not running very fast or very stable on
my webstar server. i wonder if anyone could tell me if it can be
transelated to an applescript and how to do it.
thanx!
christian
#!/usr/local/bin/perl
use LWP::Simple;
my $tekst = get("
http://www.magazinet.no/arkiv.asp");
my $body = "";
my $start = 0;
for ($i = 0; $i < 3; $i++)
{
if ($start != -1)
{
$start = index($tekst, "<a href=visnyhet.asp", $start);
$slutt = 0;
while (substr($tekst, $start + $slutt, 4) ne "<\/a>")
{
$slutt = $slutt + 1;
}
$temp = substr($tekst, $start, $slutt + 4);
$start = $start + 1;
$body = $body . $temp;
}
}
my $temp = "<a href=\"http:\/\/www.magazinet.no\/";
$body =~ s/<br>/ /g;
$body =~ s/<b>//g;
$body =~ s/<\/b>//g;
$body =~ s/>/\">/g;
$body =~ s/<\/a\">/<\/a><br>/g;
$body =~ s/<a href=/$temp/g;
$body =~ s/<\/a>/<\/a>/g;
$body = "" . $body . "";
print "";
print $body;
#print $tekst;
exit;