I've wondered about this as well, since wrote an essay on reinforcement schedules inherent in pinball games. I use the pomodoro technique, which fancy as it sounds, is just a timer that lets you check email and blogs after doing 'work' for 20/25 minutes. If you use a bit of software to manage it, it provides its own reinforcement to continue. ("you have completed x number of chunkc of work today/this week...").
Perhaps this is already well known, but it occurred to me yesterday and I thought I'd share it. The Internet seems particularly virulent as a form of procrastination; indeed, if, say, chatting at watercoolers took up as much time in the average office worker's day, we wouldn't make jokes about it. What is the feature that makes it so deadly? I suggest that it is the random reinforcement schedule: Every five minutes you "press the lever", that is, check forum X or site Y. And every six or seven checks you get the reward: Someone posted something interesting! This random reinforcement is ideal for creating addiction; thus, for example, slot machines.
As a way to avoid this effect, I'm going to strive not to do anything on the interwebs except at precisely defined times, or unless I have a specific goal in mind, say "Look up this method signature". Wish me luck, or better still, wish me willpower. :)