Greasemonkey Script Request
May 4, 2008 9:44 AM   Subscribe

Greasemonkey Script Request: A script which displays "Get Back To Work" in big letters when I visit procrastination websites (like ask.metafilter).

There are a ton of greasemonkey scripts blocking non-productive websites. However, blocking the sites entirely goes too far for me.

I am looking for a script that reminds me to get back to work but still lets me visit time-wasting websites. Something like this.

Any idea where I can find such a thing?

Bonus:
posted by chrisalbon to Technology (9 answers total) 2 users marked this as a favorite
 
Response by poster: Good catch!

Bonus: Be able to display different messages on different websites AND I running timer stating how long you have spend on that particular domain.
posted by chrisalbon at 10:11 AM on May 4, 2008


Given the special niche nature of your request, it's not real likely that there is a publicly downloadable script available to exactly do the deed you need. Yet. But a lot of Greasemonkey programmers will code up a quickie script on request; it keeps their hand in, bumps their open source karma points, alleviates boredom, or whatever. Plus, even with bonus features, the script you want is minor programming. Heck, if no one on AskMe or the UserScripts request forum spontaneously codes up a small script for you (which happens quite a bit), ping me and I'll do it. Give the young bloods first chance, see if they come up with something baroque.
posted by mdevore at 7:06 PM on May 4, 2008


If MeFi and AskMe are particular problems, you can get this script, in which you can change the "Welcome back" message to whatever you like. It won't jump out at you, but when your eye wanders across the new message...it may motivate you.
posted by Kronos_to_Earth at 7:25 PM on May 4, 2008


Have you tried Leechblock? It's a site blocker, but it's got a lot of flexibility, so that you can say "Only let me spend 30 mins on this site over the course of the workday, but let me visit it all I want during lunch."
posted by LairBob at 7:36 PM on May 4, 2008


This doesn't work for the messaging, but I have the pageaddict firefox extension, which tracks time spent on each domain you put in the list (although you have to go to the pageaddict site to see the details). Or there's the TimeTracker extension which displays a total time spent browsing (minus any specified 'work' sites) in the status bar.
posted by jacalata at 10:42 PM on May 4, 2008


Leechblock can redirect you to the URL of your choice like Get Back to Work. And you can turn it off if you want to (but you can set it so you have to enter a long guilt-tripping password like "there is nothing better I can be doing with my time" to do so.)
posted by Zed_Lopez at 10:44 PM on May 4, 2008


This is originally a Platypus script, but it will give you a starting point. The key here is the call to "do_modify_html_it" which does a regular expression replace to stick "GET BACK TO WORK!" after the "/title" element in the page. I leave it up to you to fine tune the result...

// ==UserScript==
// @name Greasemonkey-Script-Request
// @namespace Platypus
// @include http://ask.metafilter.com/90497/Greasemonkey-Script-Request
//
function do_platypus_script() {
do_modify_html_it(window.document,document.evaluate('/HTML[1]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,/\/title\>/,'/title>GET BACK TO WORK!',null);
};

window.addEventListener("load", function() { do_platypus_script() }, false);

function do_modify_html_it(doc, element, match_re, replace_string) {
match_re = new RegExp(match_re);
if (element.innerHTML) {
element.innerHTML = element.innerHTML.replace(match_re, replace_string);
};
};
posted by srt19170 at 10:15 AM on May 5, 2008


Ah, sorry, MF doesn't like HTML in comments, here's another try:

// ==UserScript==

// @name160;160;160;160;160;160;160;160;160;160;160;160;Greasemonkey-Script-Request

// @namespace160;160;160;160;160;160; Platypus

// @include160;160;160;160;160;160;160;160; http://ask.metafilter.com/90497/Greasemonkey-Script-Request

//

function do_platypus_script() {

do_modify_html_it(window.document,document.evaluate('/HTML[1]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,/\/title\>/,'/title><div align=center style="font-size:200%"><b>GET BACK TO WORK!</b></div>',null);

};



window.addEventListener("load", function() { do_platypus_script() }, false);



function do_modify_html_it(doc, element, match_re, replace_string) {

160;160;160;160;match_re = new RegExp(match_re);

160;160;160;160;if (element.innerHTML) {

element.innerHTML = element.innerHTML.replace(match_re, replace_string);

160;160;160;160;};

};



posted by srt19170 at 10:20 AM on May 5, 2008


Blech again. Well, delete the "160;"s :-)
posted by srt19170 at 10:21 AM on May 5, 2008


« Older How to find a good psychiatrist in LA??   |   The Rules of Attraction Newer »
This thread is closed to new comments.