Based on a blog post (http://blog.assaflavie.com/procrastination/) this little site dispenses funny picture from http://9gag.com in accordance with a variable reward scheme (random time intervals of 1-15 minutes) to motivate the user.
The idea is to use it only while working (pausing as you get distracted) so that working has a slot machine alike effect attributed to it acting as a motivator to keep going.
Warning: Will require self discipline.
MIT Licence
Simply download all the files and either upload them to a server, run them on a local server or straight from the local repository.
The idea is based on operant conditioning (https://en.wikipedia.org/wiki/Operant_conditioning) and the effects of positive reinforcement.