Skip to content

Script to easily block distracting websites on Windows/Linux.

License

Notifications You must be signed in to change notification settings

mcjmk/hostsPageBlocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hostsPageBlocker

Description

This simple Python script allows you to easily block URLs by rerouting them to localhost through the addition of rules in the system's hosts file. It was designed to provide an effective way to improve your focus and productivity by blocking distracting websites.

Features

  • Input: input URLs you wish to block
  • Support: Automatically generates all possible URL variations to ensure blocking works (if possible using this method).

How to run

Prerequisites

  • Python 3.6 or newer
  • Administrative privileges

Example

C:\> python main.py
Number of pages: 3
Enter URL: example.com
Enter URL: www.testsite.com
Enter URL: https://somewebsite.com

URLs have been successfully blocked!

Future Enhancements

  • Add support for Linux
  • Improve error handling
  • Add further support to user input
  • Develop a more user-friendly GUI.
  • Add more convenient options of input (e.g. pasting all URLs at once or from a txt file)
  • Implement a feature of generating larger number of entries, to make it more inconvenient to quickly unlock

About

Script to easily block distracting websites on Windows/Linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages