This website blocker is a python script that prevents users from accessing certain predefined websites during specified hours. The script runs in the background. It can improve productivity by allowing access to sites only during 'leisure hours'
- Install python on Windows
- Disable antivirus because they generally don't allow programs to modify the hosts file
- Alternatively, allow permission to execute if antivirus prompts you
- Double click web_blocker.pw to run as a background process
- This script blocks Facebook and Instagram from 0800 hours to 1700 hours
- Modify the hours in 'If' statement
- Modify the website in the website_list while listing the URLs inside the kali braces []
- Open task scheduler
- On the General Option, find the 'Actions' tab and choose 'Create basic task' and name it 'Website Blocker'
- Run with highest priviledges (IMPORTANT) as hosts file cannot be modified without admin priviledges
- On 'Configure for' choose your current version of Windows (e.g. Windows 7)
- On the Trigger Option, create new Trigger and Begin the task At Startup
- On the Actions Option, choose 'Start a program' and browse to where 'web_blocker.pyw' is located and select the script
- On the Conditions Option, uncheck 'Start the task only if the computer is on AC power'
- Click OK and run the task you have just created