This is an update on my progress with my #willhack project. As I wrote in my previous post:
my aim is to build a WordPress plugin that starts from the basis of plays expressed as a series of WordPress posts, and adds, via widgets, links to other sources based on the text you are viewing – this will be hopefully a mixture of at least the cast lists I’ve extracted, and searches of the Will’s World registry. Other stuff if I have time!
I’ve made some progress with this, and there is now code for a WordPress plugin up on GitHub although it’s still a work in progress.
I decided to use WordPress as in the past I’ve found this a shortcut for getting a hack up on the web in a usable form quickly, and the widespread use of WordPress means that by packaging the hack as a WordPress plugin I can make it accessible to a wide audience easily. I did consider using Moodle as an alternative to WordPress to target an audience in education more directly, but thought I’d probably find WordPress quicker.
I was able to write a plugin which loaded the text of the first Act of “Much Ado about Nothing” using the XML version of the text provided by the Will’s World service at http://wwsrv.edina.ac.uk/wworld/plays/Much_Ado_about_Nothing.xml. Each ‘paragraph’ in the play – which equate to either a stage direction, or a piece of dialogue by a character – is made into a WordPress post. The plugin also includes a WordPress Theme which is automatically applied, which subverts the usual ‘blog’ style used by WordPress to group all these posts by Act and Scene. The default view is the whole of the text available, but using built in WordPress functionality you can view a single Act, a single Scene or a single line of dialogue. Using the built in ‘commenting’ facility you can annotate or comment on any line of dialogue.
Each ‘post’ is also tagged with the name of the character speaking the line. This means it is possible to view all lines by a particular role, and also via a Tag cloud easily see who get’s the most lines.
So far, so good. Unfortunately at this point I hit a problem – which was when I tried to load an entire play (rather than just the first Act), I consistently got a http status 500 error. I’m pretty sure this is because either PHP or Apache is hitting a timeout limit when it tries to create so many posts in one go (each line of dialogue is a post so a play is hundreds of posts). I spent far too long trying to tweak the timeout limits to resolve this problem with no luck.
If you want to try out the plugin as it currently stands you can get the code from from Shakespearepress on GitHub (N.B. don’t install on a WordPress blog you care about at the moment – it creates lots of posts, and changes the theme and it might break). Once the plugin is activated you need to go to plugin settings page to import the text of a play (at the moment it supports the first Act of Much Ado about Nothing or the first Act of King Lear).
If you want to see an example of a WordPress blog that has been Shakespeared then take a look at http://demonstrators.ostephens.com/willhack, which uses the first act of Much Ado about Nothing:
- All of Act 1: http://demonstrators.ostephens.com/willhack/tag/act-1/
- Act 1, Scene 1 only: http://demonstrators.ostephens.com/willhack/tag/scene-1
- All lines by Beatrice: http://demonstrators.ostephens.com/willhack/tag/beatrice
- Prototype Character page for Beatrice using data from https://scraperwiki.com/scrapers/designing_shakespeare_cast_lists/: http://demonstrators.ostephens.com/willhack/beatrice-3/
- Google Rich Snippets view of the embedded microdata: http://www.google.com/webmasters/tools/richsnippets?url=http%3A%2F%2Fdemonstrators.ostephens.com%2Fwillhack&html=
Hopefully before the submission deadline I can extend the Character pages and sort the installation process so you can load a whole play and create a page per (main?) character.