Nov
12
2009

A Curious Use For Selenium – Slideshows

As a cheap, and tech-agnostic developer, I’ve particularly enjoyed using the Slideshow (S9) gem to create my slidedecks for various presentations I’ve given. Thanks to some phenomenal jQuery, I’m able to write up my talks in Markdown, generate an HTML page, and give my talk directly from the browser.

But I’m a lazy, cheap, tech-agnostic developer. To make things a bit easier, I went to the trouble of creating a continuous build system on my private git repository, that creates my HTML page when I commit the Markdown file, pushes it out to http://slides.kevingisi.com/presentation, and no manual building for me anymore.

There was a problem, however. While S9 will gracefully degrade into an outline format, there was no real way for me to display a nice thumbnail version of the slides. I was left with no distributable of my slidedeck. And sadly, Internet Explorer users were unable to view my slides, because S9 is utterly incompatible with IE (read: S9 was written in the past 10 years).

Enter Selenium! After a bit of setup, I was able to get Selenium working with Firefox-headless, to grab a screenshot of each slide in the slidedeck. Selenium, Firefox-headless, and Xvbf let me grab snapshots of each of my slides, and ImageMagick created a PDFTo make this easy, I took a copy of @jeffrafter’s Crocodile gem, made a few modifications (mainly, executing Javascript calls to advance slides before taking screenshots), set up the X virtual frame buffer out on my server (big thanks to this tutorial: Running Selenium Headless), and boom! Now, I’ve got PNG images of every slide in the deck, ready and available. Throw in a little ImageMagick (convert slide_*.png slide.pdf), and now I’ve got a fine distributable that can be uploaded to SlideShare, printed off, copied, and viewed by Internet Explorer users. Just take a look at the results!

Ruby on Rails: The Third Age

The Ruby on Rails framework is going through some radical changes. Not only are we on the cusp of Rails 3, but new technologies like InheritedResources and Formtastic allow us to do things we never could have dreamed of before. Have you seen Ryan Bates’ tutorial on building a blog in 15 minutes in Rails? Let’s cut that down to five.

Together, we’ll take a look at some of the new gems and plugins that have been released, along with some of the upcoming changes with Rails 3 to see how this technology can make your development experience even easier.

Associated Resources
Slides: HTML | PDF
SpeakerRate
Dates and Locations
Chippewa Valley Code Camp—November 14, 2009

Selenium has notoriously been used for integration testing, and @jeffrafter used it to grab screenshots of submissions for the Rails Rumble 2009, but this modification makes browser-based Slideshows even more accessible!

Nick Quaranto

Why S9 over Slidedown?

Kevin W. Gisi

@Nick, better handling of floating images, plus the outline view (and direct-to-slide navigation) is pretty awesome.

Not 100% swayed either way, but Slidedown has a bit of a ways to go.

Building Slides with Ease « Kevin W. Gisi

[...] received my first blog request recently – earlier, I posted an article called A Curious Use for Selenium: Slideshows, where I discussed how I had set up a continuous build environment to manage slide creation. I was [...]

Search