Previous month:
February 2008
Next month:
April 2008

Twitter as a Moral Compass

I recently learned a new word -- "splog." A splog is "spam blog" that takes content (often via RSS) from other sites and re-publishes it as their own, hoping to draw traffic to their own site.

You see, I've been splogged. A piece I wrote for 43Folders.com was republished by a blog in the Netherlands without crediting me or Merlin's site. I'm usually flattered when someone likes what I've written well enough to quote from it, and grateful when they acknowledge its source, but just taking an entire piece and reposting it is bad form, to say the least.

I tried to contact the owners of the offending site, but to no avail. Eventually (may my childhood pastor forgive me) my thoughts turned to revenge. The thieves are being lazy about swiping the content, so an image embedded in the piece is still pointing to its source on my server. (A practice known as "hotlinking.") I thought about getting revenge by substituting the correct image with an inappropriate one, as a way of communicating (albeit in a juvenile manner) my displeasure.

But I wasn't sure that I should so I turned to Twitter and asked my friends, and all of Twitter by inclusion, what they thought of my proposed reaction. "Do it! Do it!" came the replies, reminding me of a mob at a college party cheering on the drunk at the receiving end of a beer bong.

There were a few Twitterarians that suggested a more subtle approach, such as sending a smeared or odd-sized image, but no one suggested that I turn the other cheek.

Thus, having once again confirmed Differential Association theory, I began learning how to use Apache's "rewrite" module to make sure that the thieving website, and and no other website, displayed an alternate image when my stolen content was displayed.

My webhost offers a way to configure my site so that only approved sites can load my images, but I wasn't interested in whitelisting everywhere I want my content to appear. So, I had to write my own rewrite code, and I quickly found Stop Stolen Content with Apache mod_rewrite. This too was a whitelist approach, but it helped with the arcane rewrite syntax.

The example at SEO Black Hat was very useful, because by using the Borkweb Apache Rewrite Cheatsheet I was able to modify the code to key off the referrer header instead of the offending site's IP address. All that left me to figure out was how to intercept references to just the single file I was looking to substitute.

Here's the rewrite code I'm using:

RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://www.example.nl/.*$ [NC]
RewriteRule ^SandyInDock.jpg$ http://www.g2meyer.com/blogsupport/thief.jpg [NC]

In this code, the thieving site is www.example.nl. (changed here because I'm not going to help publicize their actual domain). The file SandyInDock.jpg is the graphic that is referenced in the HTML they swiped, and the file thief.jpg is the substitute image that I'm sending instead of the original. (It's just a blank image in this example, I'll spare you from the rude version.) That's all there is to it. Stick this code in the .htaccess file for the directory where the images are served from, and you're all set. When a viewer loads the page at the remote site, they'll get a little surprise, instead of the original image.

Oh, and the next time you want to be talked out of a questionable idea, don't turn to Twitter.


Smart Home weekly at O'Reilly Digital Media blog

You might have noticed that I've been posting a lot of links to articles I've written for O'Reilly's Digital Media blog. That's because I've signed up to write about smart homes for them on a weekly basis. You'll see a new post there from me every Monday morning. I'll continue to link to them from here, too, so you won't miss anything if you keep reading my site (and please do, I thank you for it).

Here's a link to my latest, Standalone Home Automation which describes how to automate your home with a Mac, without having to leave your computer on and in-charge of your home.

You can get a quick list of all my Digital Media articles too.