Hewligan said:

> I snatched the code from sourceforge a few days ago. Spent the weekend 
> getting Perl and MPW set up on my Powerbook. Finally got sitescooper 
> working on my Mac, but required some hacking. I had problems with 
> scoop.pm and HTMLLobotomizer.pm -> both related to the same thing, 
> namely the lines that had:
>                 qr{some search text};
> An example was line 2503 in scoop.pm. My perl did not like "qr" and I
> had to replace with:
>                 /some search text/;
> Once I had located the problem and made the changes, it all worked.
> Quick question: What is "qr" and what does it do? 

It's for quoting regular expressions for frequent re-use later, so that
the perl interpreter doesn't have to rebuild them each time -- it speeds
things up nicely (about 20% reduction on the page-parsing time I think).

I've already got a few uses of qr{} set up with dual code paths, one for
Perl 5.005 and later (which has it), and one for 5.004 (MacPerl basically,
which doesn't).  I'll take a look at fixing the others too, they must have
snuck in in the meantime.  I thought the MacPerl guys were going to do a
build with 5.005... looks like they haven't yet though...

> Also, anyone thought of a GUI for sitescooper? How difficult would a
> Java port (and javascript if need be for the Perl reg expressions) be?
> Anyway, I will start to look at the code - maybe see if I can make some
> changes to it.

I would say avoid redoing it in Java -- it would be a lot of work ;)

But a Java front-end that talked to a perl process using the STDIN and
STDOUT file descriptors might work well; just reimplement the
Sitescooper::UI class (you'd need to get the latest devel version, this
isn't in the 3.0.1 release), and redo the methods there to tag with the
correct data.  I don't know how doable that is with Mac Java though, STDIN
and STDOUT being a very UNIX-centric notion.

IMHO a better option would be to make a Mac front-end in Perl.  This is
what I've been thinking about for UNIX and Windows, too. Here's how it's
done:

  1. get the devel version first ;)

  2. look at "sitescooper.pl" and see how it creates and sets up the
  Sitescooper::Main object; that's the whole interface between user
  interface and the sitescooper engine itself.  Currently the doco is
  non-existent, but IMO it's quite easy to grasp so far ;)

  3. provide your own implementation of Sitescooper::UI that takes calls
  to verbose(), sitewarn(), cleanexit() etc. and does the right thing with
  respect to throwing text up in a GUI for certain messages.  We can
  modify the Sitescooper::UI interface to make this easier, too.

Is there a Mac UI toolkit that could be used from Perl?  For example, UNIX
perl can use GTK or Qt bindings, Windows can use the Win32::GUI module,
etc. If there's one for the Mac, then that makes things pretty easy...

--j.
_______________________________________________
Sitescooper-talk mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/mailman/listinfo/sitescooper-talk

Reply via email to