Giter Club home page Giter Club logo

kalebu / website-blocker-python Goto Github PK

View Code? Open in Web Editor NEW
107.0 3.0 45.0 244 KB

A simple website blocker project implemented in Python, It can be used to block certain websites during working time to reduce distraction thus improving productivity

Home Page: https://kalebujordan.com/how-to-build-website-blocker-in-python/

Python 100.00%
website-blocker python python-website-blocker python-project python-script python-cli-project python-beginners python3 pythontanzania tanzania

website-blocker-python's Introduction

Website Blocker Python

Intro

Hi Guys 👋

This repository consists the code of a simple website blocker project implemented in Python. It can be used to block certain websites during work time to reduce distraction thus improving productivity.

The magic

The magic of this project lies on modifying the host file within your computer that manages how you access the web.

Getting started

Well to get started with this project just clone the repository and edit the host file location depending on the OS your using.

    $-> git clone https://github.com/Kalebu/Website-blocker-python
    $-> cd Website-blocker-python
    $ Website-blocker-python ->

Adding sites to block + Editing host files

Now open the app.py and then go to line 4 with variable site_to_block and you can add the sites you would like to block during work time

the script will automaticaly detect your OS and will add the host records to the relevent location

One more thing

You would need to set up the starting working + ending working hours where you would like to be restricted from accessing those websites. To do this go to line last line of our code and edit the hours where by.

time_to_block

Congratulations

Well done you now have a fully functioning website blocker that you have made yourself to improve your productivity, in Python

Issues

Incase you have any difficulties or issues while trying to run the script you can raise it on the issues

Pull Requests

If you have something to add, I welcome pull requests that improve the project, your helpful contribution will be merged as soon as possible.

Give it a Star ✴️

If you find this repo useful , give it a star

Credits

All the credits to kalebu

website-blocker-python's People

Contributors

akashhansda avatar avinash7375 avatar dadyutenga avatar devender15 avatar kakalpa avatar kalebu avatar kalebujordan avatar om-mishra7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

website-blocker-python's Issues

permission error

giving this error:

Traceback (most recent call last):
File "C:\Git\main.py", line 43, in
block_websites(9, 21)
File "C:\Git\main.py", line 31, in block_websites
with open(default_hoster, "r+") as hostfile:
PermissionError: [Errno 13] Permission denied: 'C:\Windows\System32\drivers\etc\hosts'

despite running form admin mode in cmd

Permission denied error

with open(default_hoster, "r+") as hostfile:

PermissionError: [Errno 13] Permission denied: 'C:\Windows\System32\drivers\etc\hosts'

Can you please help me solve this error. I tried to run using administrative privileges but still got the error.

Permission denied error in Linux

Like the other issue, but I have it in linux.
with open(default_hoster , "r+") as hostfile:
IOError: [Errno 13] Permission denied: 'etc/hosts'

permissions root issues

your script assuems all acces but as linux i woudl ask to add sudo enable asa norma does nt have etc folder permission to modifu hsts so your expected result ends failing wth a permsioon diened

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.