Wiff.me - A webpage differ

June 25, 2010

The other night at nopoconi I drank a couple Super Dog IPAs and hacked together a tiny web application that will run the content of any two web pages through a diffing tool. It’s up on wiff.me.

In the process I also discovered this crazy bash command that will pipe two web requests as inputs through diff using subshells. It’s kind of an insane one-liner.


diff <(curl 'drasticcode.com') <(curl 'www.drasticcode.com')

Needless to say I punted on trying to use the one-liner in the web based version. Echoing user provided data to the shell scares me. @donpdonp taught me how to sanitize the user provided data in the bash command. Just replace any single quotes in the user provided urls with two single quotes. I still ended up using Sinatra and Curb.