Paris.pm technical meeting

cross-posted from dams blog

Paris.pm technical meeting

( french version below )

The next Paris.pm technical meeting will happen the 25th september 2012, with:

  • Elizabeth Cholet: Firefox automatization with Perl using AnyEvent, Coro and MozRepl modules

Location : 181 avenue Daumesnil, 75012 Paris, France

Google map : google map

If you are interested, and live in Paris, please join us ! If you need more info, ask in the comments.


La prochaine réunion technique de Paris.pm se tiendra mardi 25 septembre 2012, et le programme est :

  • Elizabeth Cholet : l'automatisation de Firefox avec Perl en utilisant AnyEvent, Coro et les modules MozRepl

Adresse : 181 avenue Daumesnil, 75012 Paris

Google map : google map

Si vous êtes intéressé, n'hésitez pas à venir, entrée libre et gratuite. Pour plus d'info, demandez dans les commentaires.

dams.

5 Comments

I'd love to see the slides for this.

They're in French but I'll prepare an English version if you like.

I'd love an English version of the slides if you have the time and resources!

I recently wrote a FF automation script using MozRepl. It was challenging, fun and rewarding -- the source to WWW::Mechanize::Firefox was invaluable!

And by coincidence, I recently wrote an HTTP service request library using AnyEvent. There's a comment in one of the MozRepl modules about needing to rewrite Net::Telnet with AnyEvent, and I've thought about accepting that challenge.

Anyway, so I'm very curious about the AnyEvent and Coro bits of the presentation!

Hello Jake,

I did a translation of the slides while home sick, hence it's minimal and may not be clear. Let me give you a little narrative on how it all fits together. It's really pretty simple.

I am having to drive Firefox with the extensions PageSpeed, YSlow and NetExport installed, and capture their output which they send via HTTP POST. I accomplish this in the following way:

I use WWW::Mechanize::Firefox (and sometimes dip down to MozRepl::RemoteObject) to drive Firefox: set preferences, load URLs, clear the cache. The extensions are configured to send their output back to the driving program, which has...

....an instance of AnyEvent::HTTPD, with handlers for each type of output expected. This web server runs in its own Coro thread so it doesn't get in the way of the rest of the program. It is possibly the simplest use of Coro imaginable. (But then one characteristic of a good tool is tht it works for both simple and complex tasks). These handlers receive the output, munge it and repost it to another server using AnyEvent::HTTP.

I can't let URL loading get ahead of output processing, so I use Coro::Signal to coordinate the two threads; and I use Coro::Channel to pass information between the two threads.

That is IT! Nuthin complicated.

I should probably repost this to my own blog, perlgerl.com. Not that it matters, I had like zero readers.

Hope that opens possibilities,

Liz

Leave a comment

About Damien "dams" Krotkine

user-pic I blog about Perl.