Gan’s Homepage

Time to Go: a script to fight procrastination

at 10:01 am

Install Time to GoLet’s face it: web surfing can be very time wasting, especially when you have some deadlines to meet. To those weaker souls, we have techniques to prevent ourselves from those highly addictive web sites, such as changing the domain mapping to localhost, or using the “invisible cloak” or “kiwi cloakGreasemonkey scripts. These techniques completely ban us from accessing the sites.

But occasionally we really need a short slashdot/digg/lifehacker/engadget/etc break in the middle of our heavy work. Yes, we can modify the domain mapping back to normal, but that’s too troublesome; Yes, we can disable the Greasemonkey scripts for a moment, but after several times you may tempted to disable them forever.

What we need is a script that allow us to visit an addictive site for, say, one minute only. Once the time is up, the screen turns blank, and you get back to work.

So this is the central idea of my Time to Go script. Here is a list of features:

  • Big count-down counterIn the last 10 seconds, a big, BIG count-down counter will appear to tell you it’s about time to go. (Click the image to see it in action with animated gif.)
  • If you really, really need a bit more time to stay, click the counter to “recharge” it for 10 more seconds.
  • The counter can be set to keep counting across different pages of the same site. Thus you won’t be able to surf indefinitely by keep navigating different pages of the site (you know that’s cheating, dude).
  • Option panelApart from about:blank, you can set it to redirect to any other page. How about: your boss’s portrait with an angry face that you’ve uploaded to Flickr!
  • Open the option panel by selecting Greasemonkey menu > User Script Commands > Time to Go::Options, where you can change a few settings. (You may also use the hotkey Alt-G.)

Also: See WebStats, another Greasemonkey script of mine!

This script has been tested on Firefox 2.0.0.3 (Windows XP), with Greasemonkey 0.6.9.20070507.0. Leave comments to report bugs or request features!

Greasemonkey basic

  • You have to enable your time-wasting website to use my script first. Otherwise, the counter and option panel won’t show up. To do that, right click on the Greasemonkey status bar icon , select Manage User Scripts, click on Time to Go, and then Add the site to Included Pages by entering something like http://www.yoursite.com/* .

Version history

  • version 1.6.1 (5 June): fixed a bug that the counter was not showing
  • version 1.6.0 (3 June): the option panel is now more, well, pretty! (does it justify a new version? yes of coz!)
  • version 1.5.1 (30 May): the option panel can be opened by pressing the hotkey Alt-G.

Possible to-do

  • A prettier config panel
  • “Cross-page counter”
  • An even prettier config panel…
  • “Off hours” ??
  • “Holiday mode” ??

Comments

  1. At 18 May 2007 2:31 am, Hendrik said:

    Brilliant. Thanks for the script.
    An idea for improvement: I think it would be nice to redirect to a page that says “Time’s up. Get back to work!” or something like that. Along with the title of the previously displayed page. Not a link. I like how it currently redirects without giving you the option to just reload or use the ‘back’ button to easily return to procrastination.
    Could there be a way to keep the counter going even if you move around within the offending web site? So if I visit a bunch of different pages under http://slashdot.org/* for example.

  2. At 20 May 2007 8:19 pm, Gan said:

    Thanks for the comment, Hendrik! “Cross-page counter” should be implementable, probably by using cookies.

  3. At 24 May 2007 2:00 am, Hendrik said:

    I just took a look at Greasemonkey. Seems like GM_setValue and GM_getValue could work. And actually now I see you are using those already.
    Could you just store the root URL (domain name) and the time of visit for the current web page in two keys?
    Then at script startup you can check if the last page visit was on the same domain and if that visit was within 1 minute (or the user specified duration), and if yes, set the remaining time relative to that.

  4. At 26 May 2007 1:22 am, Gan said:

    Well, I was thinking of using cookie because with it I can handle the domain checking and auto-expire easily…

    But then I realized that using cookie in javascript is a pain in ass. So, yes, I’d probably use GM_setValue to implement that. Should be ready within this few days. :-D

  5. At 28 May 2007 9:51 am, Hendrik said:

    Awesome. Looking forward to it.

  6. At 28 May 2007 9:03 pm, Gan said:

    It’s now updated to version 1.5.0!

    And I just have a horrible idea of using this script. Install it on your coworker’s firefox, enable it for the company’s intranet frontpage, set timeout to 30, recharge count to zero, and finally, set the redirect destination to goatse.cx …

  7. At 29 May 2007 11:54 pm, Scott said:

    Hi Gan - I installed the script but the “User Script Commands” menu is still disabled. I have GreaseMonkey 0.6.9.20070507.0, FF 2.0.0.3 on WinXP: any ideas?

  8. At 30 May 2007 12:46 am, Gan said:

    Scott, is the script working fine except the menu? The default setting should be 60s. Do you see the counter in the last 10s?

    And maybe my script is not compatible with the others. Could you disable all the other greasemonkey scripts and try again? Thank you for your help!

  9. At 30 May 2007 12:49 am, How To Get Back To Work | How To Split An Atom said:

    [...] us who lack the time management skills and willpower to do it ourselves, there is a really fantastic Greasemonkey script that will get you back on [...]

  10. At 30 May 2007 2:55 am, G said:

    I’m having the same “user script commands” issue as Scott, using the same versions of Greasemonkey and Firefox, with no other Greasemonkey scripts installed.

    I do get the countdown window, so the default configuration seems to work.

  11. At 30 May 2007 4:23 am, Techzi » Blog Archive » Featured Greasemonkey User Script: Fight procrastination with Time to Go said:

    [...] to Go is a free download that works with Firefox and the Greasemonkey extension. — Kyle Pott Time to Go [...]

  12. At 30 May 2007 4:45 pm, Evita perder el tiempo con Time to Go said:

    [...] Time to Go es un script para Greasemonkey en el que podremos configurar un tiempo máximo para visitar un sitio web. A falta de 10 segundos se nos mostrará una cuenta atrás que nos indica que el tiempo se está agotando, y cuando el contador llegue a cero el script nos redirije a un página web que nos motive para trabajar, como por ejemplo una foto del jefe con cara de pocos amigos alojada en Flickr. [...]

  13. At 30 May 2007 4:52 pm, Andrew Peacock said:

    Same problem as above - “User script commands” is greyed out.

    FF version 2.0.0.3
    GM version 0.6.9.20070507.0

  14. At 30 May 2007 4:55 pm, Andrew Peacock said:

    Ah, got it - the options are greyed out only when you are on a domain which is NOT listed for the plugin. So for the default install, go to digg.com and you should see the options.

    Andy

  15. At 30 May 2007 11:06 pm, Gan said:

    For those who have problem opening the option panel, please try using version 1.5.1. You may now press Alt-G as well to call out the panel.

  16. At 31 May 2007 6:25 am, Koen said:

    I am also having trouble with the “user script commands” being disabled, using version 1.5.1 with no other scripts running. I’ve tried Alt-G to no avail.

  17. At 1 June 2007 2:11 am, G said:

    Version 1.5.1 is working for me. The configuration menu item appears somewhat sporadically (usually when visiting a site that you’ve added to your restricted list, seems like) so it’s worth navigating around and refreshing things a bit to see if that helps.

  18. At 1 June 2007 2:18 am, Gan said:

    Hi, G. Glad to hear that it’s working for you now.

  19. At 1 June 2007 6:03 pm, » 10 Ways to Eliminate Distractions said:

    [...] time-wasting sites (and yes, you know which ones they are) until a predetermined time, or use Time To Go to only allow you to surf a site for a certain amount of time. Great choices for those of us who [...]

  20. At 9 June 2007 5:30 pm, Climens Codelog » 10 modos de eliminar distracciones said:

    [...] Cloak o Kiwi Cloak permiten restringir el acceso a ciertas páginas durante cierto horario o Time to Go, que temporiza el acceso a Internet y lo bloquea cuando llevamos demasiado tiempo. A mi [...]

  21. At 14 June 2007 11:43 pm, Henrik said:

    Excellent work!
    That options pane sure is pretty. Although the cross pages tracking checkbox looks odd (at least here in Firefox on OSX, looks like a text field)

  22. At 5 October 2007 3:38 pm, Come smettere di perder tempo sul web | Googlisti.com said:

    [...] Time To Go Script è ancora uno script per Greasemonkey che, invece di impedire la navigazione di certe pagine, ne concede la visione, sì, ma per 1 minuto soltanto, giusto il tempo di una pausa veloce! A 10 secondi dal termine, un evidente conto alla rovescia segnala che il tempo per le distrazioni sta per scadere: in casi estremi possiamo prolungare la navigazione di altri 10 secondi, ma poi una schermata bianca (o una diversa pagina di destinazione inserita dall’utente) ci impedisce di andare oltre. [...]

  23. At 12 February 2008 7:22 am, Bloqueie sites durante determinado período de tempo | fator W said:

    [...] primeira é o Time to Go, um script que deixar você usar os sites que você definir apenas por curtos períodos de tempo. [...]

  24. At 22 March 2008 12:21 pm, SD said:

    Fabulous concept! New to using Time to Go and perhaps this feature exists and I haven’t discovered it yet, but it would be great to be able to set different time limits for different web pages and to set total caps for the day. Thx for building this!

  25. At 24 July 2008 12:49 am, Scripts update « Gan’s Homepage said:

    [...] Time to Go (v 1.6.1): The new version now has a much prettier option panel. [...]

  26. At 24 July 2008 12:50 am, WebStats: a script to find out your web surfing statistics « Gan’s Homepage said:

    [...] that you have userscript that stops you from spending too much time on some productivity-destroying sites. We can simply [...]

  27. At 24 July 2008 12:51 am, The rise of mini-programming « Gan’s Homepage said:

    [...] to learn some simple Javascript, write up a Greasemonkey userscript, and put it on your blog just like me! Read other posts on: Computer, Programming Read other posts with tags: Fatal error: Call to [...]

Post your comment