One of my favourite Popfly blocks is the “Whack-A-Mole” block for no other reason than because it’s fun and entirely pointless. JamesO suggested it might be a cool idea to combine a bit of Whack-A-Mole with an IE8 accelerator: a user can highlight a bit of text and then we’ll perform a Live image search and use those images to populate a Whack-A-Mole game.
Why wouldn’t you want to do that? So, off to work.
Writing an accelerator for IE8 is actually a complete doddle. You can see the development guide here or a couple of examples from Tim Heuer and Katrien. (Actually, I wrote this while I was on a conference call with Angus…)
So it boils down to a bit of XML. Here’s mine which consists of nothing more than a description and the URLs and parameters to preview and execute the action:
In this case, the XML is pointing at a web page on my site, that is going to render out the preview pane and/or the main pane depending on the behaviour I desire, or the user chooses. (As far as accelerators go, that might be it – could easily be good enough for your particular service.)
So now a bit of Popfly work is needed to create my mashup. Here you can see three blocks attached together.
Stepping backwards through them, we have the end output – the Whack-A-Mole block – which is hooked up to receive the input from the second block – the Live Image Search block. That block takes its cue from the first block – the User Input block. This is fairly diverse in that it can be taking ‘user input’ from the querystring of the incoming URL – so that’s handy… Anyway, you can see this fairly simple mashup here.
Final piece in this puzzle is that when I share out my Popfly mash-up, I embed it as an IFrame. So, in order to interpret the URL of the web page it is embedded in, I’ve used some simple Response.Write stuff to create the IFrame correctly. Notice I’ve also hardcoded some width and height parameters to ensure it fits the preview window in IE8.
Job done. If you want to install my “Whack” accelerator you can click the button below (assuming you have IE8 Beta 2 installed):
Of course, Whack is fairly useless but the use of Popfly to create services exposable as accelerators could probably give rise to some really useful stuff. (In fact, it might be cool if “sharing a Popfly mashup as an accelerator” was an option in Popfly. Hmm…)
