Turns out that figuring out how to embed a Processing Java applet in WordPress was quite the endeavor.   Ended up writing a Wordpress plugin. Here is a link to the tarball: wp-proc-embed.tar.gz

A few brief instructions for installation and use:

  1. Extract into the wp-content/plugins directory (Same as every other plugin for WordPress).  If you can’t figure out how to extract a .tar.gz file, and I’m in a good mood, let me know and I’ll create a zip for you.
  2. Login to wordpress as admin and activate the plugin.
  3. Export your Processing project.
  4. Copy/scp/ftp the entire directory tree of the sketch (which should now include an applet directory) to wp-content/plugins/wp-proc-embed/
  5. As an example of what the directory structure should look like in step 4 I have included the applet “threeballsclass”.  The exported java files appear in wp-content/plugins/wp-proc-embed/threeballsclass/applet/
  6. Make a new post and include the following tag to display the threeballsclass applet with a dimension of 200 x 200:   LEFT BRACKET processing=threeballsclass 200 200 RIGHT BRACKET
  7. Publish and Pray.
  8. I just realized that I called the example project “threeballsclass” and there are actually four balls flying around.  Deal with it.

Here’s the applet in action:

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

(If anyone knows the escape character for the left and right brackets, so I don’t have to use LEFT BRACKET and RIGHT BRACKET above, let me know.  I’m having to do this because otherwise it displays the applet)

Tags: , , , ,