• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
perl to applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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;


  • Prev by Date: Re: URL access scripting
  • Next by Date: Re: even better coerce to record with usrf
  • Previous by thread: OS X AppleScript Documentation
  • Next by thread: Startup Disk in 9.2.2
  • Index(es):
    • Date
    • Thread