Skip to content

Latest commit

 

History

History
93 lines (62 loc) · 3.34 KB

File metadata and controls

93 lines (62 loc) · 3.34 KB

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.