Productivity Saver

Redirects people to video if someone goes to reddit between 9 AM and 6 PM (inclusive).

Verze ze dne 21. 11. 2015. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name Productivity Saver
// @description Redirects people to video if someone goes to reddit between 9 AM and 6 PM (inclusive). 
// @include https://*.reddit.com
// @include https://*.reddit.com/*
// @run-at document-start
// @version 0.0.1.20151121085600
// @namespace https://greasyfork.org/users/12417
// ==/UserScript==

// This whole code is meant to block websites you apply to this script to from 9 AM to 6 PM, with 1 check per minute.
// For any further inquiries, please tell me at scratch.mit.edu/users/iamunknown2 or reddit/u/iamunknowntwo

function check() // This function will set the hours variable (which will specify the hours in the day).
{
    var date1 = new Date();
    var hours = date1.getHours();
    
    if (hours >= 8 && hours <= 17) // If hours are 8 AM to 7 PM (inclusive)
    {
        window.location.href = "https://www.youtube.com/watch?v=ZXsQAXx_ao0"; // Will play "JUST DO IT" Shia LaBeouf speech
    }
}
check() // Will check first time run.
setTimeout(check(), 60000); // Checks above code per minute.