{"id":29856084,"url":"https://github.com/mscbuild/web_blocker","last_synced_at":"2025-07-29T23:35:50.827Z","repository":{"id":298674545,"uuid":"1000728331","full_name":"mscbuild/web_blocker","owner":"mscbuild","description":"🤖 Python Website Blocker. Software that prevents annoying websites from appearing.","archived":false,"fork":false,"pushed_at":"2025-06-12T09:25:12.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-12T09:37:37.080Z","etag":null,"topics":["basic","block","developer","developer-tools","project","python","security","testing","virus","website"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mscbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-12T08:26:41.000Z","updated_at":"2025-06-12T09:26:29.000Z","dependencies_parsed_at":"2025-06-12T09:40:05.947Z","dependency_job_id":null,"html_url":"https://github.com/mscbuild/web_blocker","commit_stats":null,"previous_names":["mscbuild/web_blocker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mscbuild/web_blocker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2Fweb_blocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2Fweb_blocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2Fweb_blocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2Fweb_blocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mscbuild","download_url":"https://codeload.github.com/mscbuild/web_blocker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mscbuild%2Fweb_blocker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267780410,"owners_count":24143204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["basic","block","developer","developer-tools","project","python","security","testing","virus","website"],"created_at":"2025-07-29T23:35:44.086Z","updated_at":"2025-07-29T23:35:50.812Z","avatar_url":"https://github.com/mscbuild.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛠️ Project: Python Website Blocker\n   ![](https://komarev.com/ghpvc/?username=mscbuild) \n ![](https://img.shields.io/github/license/mscbuild/e-learning) \n ![](https://img.shields.io/github/repo-size/mscbuild/web_blocker)\n![](https://img.shields.io/badge/PRs-Welcome-green)\n![](https://img.shields.io/badge/code%20style-python-green)\n![](https://img.shields.io/github/stars/mscbuild)\n![](https://img.shields.io/badge/Topic-Github-lighred)\n![](https://img.shields.io/website?url=https%3A%2F%2Fgithub.com%2Fmscbuild)\n\n\n# 📌 What It Does\n\nBlocks specified websites during working hours by editing the system's  `hosts` file.\n\n# 📁 Files and Structure\n\nYou only need one main Python file:\n\n~~~ruby\nwebsite_blocker.py\n~~~\n\n# 🧰 Requirements\n\n- Python 3.x\n\n- Admin/root privileges (to modify the `hosts` file)\n\n# 🧠 How It Works\n\n- Modifies the hosts file on your system.\n\n- Redirects websites to 127.0.0.1, essentially blocking them.\n\n- Unblocks them after working hours.\n\n# ⚙️ Location of hosts File\n\n- Windows: `C:\\Windows\\System32\\drivers\\etc\\hosts`\n\n- Linux/Mac: `/etc/hosts`\n\n # 🧾 Sample Code\n\n ~~~ruby\nwebsite_blocker.py\n~~~\n\n# ⚠️ Note\n\n- Run as Admin/root: You’ll need to run the script with administrative privileges.\n\n- Schedule It: Use Task Scheduler (Windows) or `cron` (Linux/macOS) to run it in the background.\n\n # ✅ Possible Upgrades\n \n- GUI using `tkinter` or `PyQt`\n\n- Add/Remove websites dynamically\n\n- Block based on categories (social, entertainment)\n\n- Notifications or logging\n\n# 🎨 Python Website Blocker with GUI (tkinter)\n  \n✅ Fe\n \n- GUI to\n\n- S\n\n- View\n\n- Ru\n\n# 📁 File: `website_blocker_gui.py`\n\n# ⚙️ How to Run\n\n- Run with admin/root permissions.\n\n- Run the script:\n\n~~~ruby\npython website_blocker_gui.py\n~~~\n- Add websites, and click Start Blocking.\n\n# 🧠 Optional Enhancements\n\n- Save/load blocked websites list to file\n\n- Customize working hours in GUI\n\n- Tray icon or minimize-to-tray\n\nAuto-start on system boot\n\n# 🛠️ Steps to Convert to a macOS App\n\n**Step 1: Install PyInstaller**\n\nFirst, you'll need to install PyInstaller to\n~~~ruby\npip install pyinstaller\n~~~\n**Step 2: Create**\n\n- Navigate to the directory where y\n\n- Run the following command to create a standalone app (this will generate a `.app` fi)\n\n  ~~~ruby\n  pyinstaller --onefile --windowed website_blocker_gui.py\n  ~~~\n- `--onefile`: Pa\n\n- `--windowed`: Preve\n\nThis will generate a `dist` folder cwebsite_blocker_.\n\n ***Step 3:***\n \nOnce PyInstaller finishes, you should see a .app file in the `dist directoryWebsite GUI jus\n\n***Step 4:***\n\n- If yo\n\n- Creat (if you)\n\n- Open Keychain A andDevelo certi\n\n- Use t\n  ~~~ruby\n  codesign --sign \"Developer ID Application: Your Name (Team ID)\" path/to/website_blocker_gui.app\n  ~~~\n\n  ***Step 5:***\n  \nIf you want to create a downloadable disk image for distribution, you can package the `.app` file `.dmg` file for\n\n- Install `create-dmg`:\n~~~ruby\nnpm install -g create-dmg\n~~~\n- Run th\n~~~bash\ncreate-dmg \"dist/website_blocker_gui.app\" \"dist/website_blocker_gui.dmg\"\n~~~\n\nThis will generate a `.dmg` file, w\n\n# 🎉 Y\n\nNow you have a standalone macO that runs yo\n\n# Notifications\n\n\n\u003e [!NOTE]\n\u003e If you use an app-level blocker, make sure it is protected from abuse..\n\n\u003e [!TIP]\n\u003e Blocking websites may not always be effective, and users can bypass blocking. It is just one tool for increasing security and control.\n\n\u003e [!IMPORTANT]\n\u003e A real application would require more complex mechanisms for processing requests, filtering, storing a list of blocked sites, etc.\n\n\u003e [!WARNING]\n\u003e Warning: Site blockers may conflict with other network and browser settings. Please note potential issues and possible alternative solutions.\n\n\n# 📜 License\n\nMIT License © 2025 \n\n\n\n\n\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscbuild%2Fweb_blocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmscbuild%2Fweb_blocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmscbuild%2Fweb_blocker/lists"}