Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

There are two questions I've flirted with over the past few months and finally getting a little time to look around, I think I've gotten myself stuck.

Yahoo Games! game page has lots of JavaScript for their game entry links, though I haven't tested WWW::Mechanize on it, I'm sure it'll work with these just fine.

The rooms are filled with spam bots, oh Gads is it ever. Once in a while there's someone in there with a blank bot, not sure what else to call it really. What it does is, when it finds detected keywords from a spam bot's message, it posts some 6 or more lines of blank replies to push it off the screen. I've looked for these online but I couldn't find any.. so here I am wanting to make one.

I can do the logging in AND the keyword searching (once I know how to parse the text since it's a JavaApplet), but I need to know how to process the text field and 'enter' key along with reading in text.

Now I realize the other programs out there are more than likely in a compiled language like VB or C, but can Perl interact with a Java form?

  • Comment on Using Perl to perform java applet forms

Replies are listed 'Best First'.
Re: Using Perl to perform java applet forms
by xdg (Monsignor) on Mar 17, 2006 at 18:24 UTC

    You might be better off trying to do this with Greasemonkey.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: Using Perl to perform java applet forms
by dorward (Curate) on Mar 17, 2006 at 17:23 UTC

    Actually running a Java Applet and interacting it is a bit beyond my current knowledge (and I don't care enough to spend time on Google finding out if its been done :D ). But one approach would probably be to sniff the traffic between the applet and the server, reverse engineer the protocol, and then write your own client for it.

      Oh, is that all? :D Actually I was sort of assuming it would be that difficult to do this if there aren't Google references for things like this.

      I'd appreciate any sort of information, links, code, etc that anyone might have that would aid me in the right direction.

        tcpdump will let you sniff the traffic, as might setting up a proxy server that logs all the traffic.

        If you're lucky they'll use a human readable and standardised means of communicating - like SOAP.

Re: Using Perl to perform java applet forms
by zer (Deacon) on Mar 17, 2006 at 17:32 UTC
    ya perhaps building a proxy with perl would work best... monitor how the script communicates with the yahoo servers.. figure out what the signals are and send then work from there. youll probably have to monitor something other than http so check it out with netstat before you start coding.