Skip to content

mustafadalga/website-blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Website Blocker

A script developed to block access to specified websites during specified hours.

  • Normally, we would have to run the Python script manually each time. To avoid this, I created a task scheduler script using PowerShell. This PowerShell script ensures the Python script runs in the background every time the computer session starts.

  • You can also create a scheduled task by following the steps of the PowerShell script using Windows' own scheduled tasks settings, without running the PowerShell script itself.

Defining Websites and Hours to Block

  • Within the websiteBlocker.pyw file, the desired websites to be blocked are added to the website_liste list.

  • The start and end times for blocking the specified websites are written to the baslangicSaati and bitisSaati variables.

Example Usage

  • As an example, I will block Google between 08:00 AM and 06:00 PM.

  • I am creating a scheduled task by running the zamanlanmisGorev.ps1 file I created with PowerShell.

  • After creating the scheduled task, the Python script will run in the background every time a session starts.

    zamanlanmisgorev

  • Upon the next session login, webBlocker activated.

  • As the time was 02:06:09 PM (14:06:09), https://www.google.com, google.com, and www.google.com addresses were added to the hosts file.

Hosts file

hosts_dosyasi

Google

engellenen site2

Hosts file

hosts_dosyasi2

Google

engellenmemis site

About

A Python script that blocks access to specified websites during certain hours.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published