Friday, January 15, 2010

Right-click blocking rant

We had another request come in to the office to write code that will keep people from stealing their images. They want us to block the right-click on the page. It doesn't seem to matter how well you explain that if someone wants your images, they will get them.

Anyone that has ever used the internet, given 15 minutes and Google, could steal images from a site that blocks right-clicks. This is the equivalent of scotch-taping your doors shut for security. The thief is going to laugh at you. The regular people viewing your site might just get annoyed when they accidentally right-click instead of left-click and they see a nasty popup. I know a lot of older people that right-click everything.

The only way to stop them from taking your images is to make them not want your images. Make them ugly with a watermark, or text, or even make the image small or of bad resolution. This will make your website look bad, but your images will be safe.

Personally, I say, just give up. Why do you care if someone wants your picture of that building. Life is too short to care about it. If you see someone using your image, say, hey that's mine, and feel proud that you actually made something worth stealing.

Monday, January 11, 2010

Email Spiders Suck!

Unsolicited email sucks. No question about it. Now it's getting worse than ever. We all know that it costs you time filtering your email to get rid of the spam, but now it's going to start hitting your wallet directly, in the form of bandwidth. You see, those spammers need to get new email addresses constantly, or their lists become outdated. Outdated lists are useless, and can't be sold for big money. How do they get new addresses? They've got many ways, including guessing, purchasing, viruses, spyware, and of course spidering websites. This is what we're going to focus on today.

The amount of web bandwidth that we lose everyday to web spiders is astronomical. Some of them are legitimate and are used for the big name search engines, like Google, Yahoo, Bing, etc..., but there are others that are just plain evil. They don't follow the rules. They'll hit websites so hard it can bring them down.

This is what I do now. I fight evil spiders. I've built a spider trap. Some people call this a honey pot. It lures them in catch them, and block them. I knew I could block them by IP if I could separate them from the regular traffic. The question is, "how do you separate the spiders from the regular users?" That's the toughest part.

So I built a webpage, and told the legitimate spiders not to ever go there in my robots.txt file. Then I added a small hidden link, on my real pages, with a specific instruction "rel=nofollow" so that the legitimate spiders again, will not go there.

Spiders still go there - evil spiders. I add their IP to my list, and save that list to an xml file. Then when someone hits my pages, I first check the IP against this list. If they've hit my trap within 72 hours, I send them a nice page telling them that they either have a bot, or are spidering my sites illegally. This has reduced my traffic a lot.

Now this worked well for a few weeks, but then my spider list got big. I had hundreds of IP addresses in my xml file list. I had to start keeping the list in memory, because reading it in for every page view was too slow. I now have it in memory and reload it every 20 minutes or whenever someone hits the spider trap. Seems to be working well.