Skip to content

This Python project helps you stay focused by blocking certain websites during the hours you choose. It’s a simple way to reduce distractions and boost productivity.

License

Notifications You must be signed in to change notification settings

deepikagandla7456/Website-Blocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

GitHub license GitHub issues GitHub contributors GitHub last-commit

Website Blocker Logo

Boost your productivity with the Website Blocker!
This simple Python tool helps you block distracting websites like Facebook, Instagram etc., during your focus hours. Whether you're studying, working, or just trying to stay off from social media, this tool ensures you stay on track.

Make the most of your time. Stay productive with Website Blocker.

Block distractions and Unlock focus.


About

Website Blocker is a Python script that helps users to avoid distractions by blocking specific websites (e.g., Facebook, Instagram) during a selected time (e.g., 7 AM to 10 AM).
It works by modifying the system’s hosts file to redirect those websites to 127.0.0.1, making them inaccessible during that period.


Limitations & Future Work

  • Requires admin/root privileges to edit system files.
  • Only works on local machines.
  • Time range is fixed in code (can be modified manually).

Future Work

  • Add GUI for selecting websites and blocking hours.
  • Notification before blocking/unblocking.
  • Option to log blocked attempts.

Features

  • Set specific hours to block websites.
  • Improves focus and productivity.
  • Customizable website list and time range.
  • Automatically unblocks sites after the set time.

Requirements

  • Python 3.7 or higher version

Setup and Installation

  1. Clone the Repository
    git clone https://github.com/deepikagandla7456/Website-Blocker.git
    cd Website-Blocker
  2. Run the Script
    python app.py
    Make sure to run it as Administrator on Windows or use sudo on Mac/Linux.

Usage

  • This script continuously checks the system time.

  • If current time is in between 7 AM and 10 AM, it blocks the sites listed in website_list

  • Outside that time range, it unblocks those websites.

  • You can change time and sites by editing the values in app.py

Screenshots

Before Blocking the Site Image

Websites like Facebook, Instagram etc., open normally before the script starts running.

During Blocked Hours Image

When the script runs between 7 AM and 10 AM, the listed websites are blocked and show an error message when accessed.

After Blocked Hours Image

Once the blocking time ends, the websites are unblocked and accessible again as usual.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

This Python project helps you stay focused by blocking certain websites during the hours you choose. It’s a simple way to reduce distractions and boost productivity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages