Skip to content
Proyek

Mahdi-hasan-shuvo/facebook-automation-python

Lihat di GitHub

Tentang

✅ Python-powered open-source Facebook automation toolkit. Auto-delete posts, manage groups, invite users, decline spam & scrape data. Built with requests & BeautifulSoup. Beginner-friendly. 🤖

Produktivitas dan otomatisasi

Cara angka ini diukur

Yang dapat Anda lakukan

  • 🗑️ post_delete.py - Bulk-delete posts from Facebook groups you manage
  • 🚪 group_leav.py - Leave multiple Facebook groups automatically
  • 📨 group_invite.py - Auto-invite users to a Facebook group
  • ❌ spam_decline.py - Auto-decline spam group join requests

Pertumbuhan bintang terukur

dalam 24 jam
0
dalam 7 hari
+1
dalam 15 hari
Mengumpulkan riwayat
dalam 1 bulan
Mengumpulkan riwayat

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli


Stars Forks Issues PRs Welcome Python License Open Source


🤖 Automate repetitive Facebook tasks with Python — bulk delete posts, manage groups, invite members, decline spam, and scrape data. Free & open-source.


🚀 Get Started · ✨ Features · 📂 Structure · 🤝 Contribute · 📬 Contact



✨ Features

All features below are based on files that actually exist in this repository.

Script What It Does
🗑️ post_delete.py Bulk-delete posts from Facebook groups you manage
🚪 group_leav.py Leave multiple Facebook groups automatically
📨 group_invite.py Auto-invite users to a Facebook group
❌ spam_decline.py Auto-decline spam group join requests
📦 dump_fb.py Scrape and export Facebook data for analysis
🔍 mabsic group finder/ Search and discover Facebook groups by keyword

🧰 Tech Stack

Tool Purpose
Python 3.x Core language — all scripts are 100% Python
Selenium Controls Chrome to interact with Facebook like a human
BeautifulSoup4 Parses HTML to find and extract page elements
Requests Handles HTTP requests and responses
ChromeDriver Bridges Selenium to your Chrome browser

📂 Project Structure

Facebook-automation/
│
├── post_delete.py          # Delete posts from groups you manage
├── group_leav.py           # Leave Facebook groups in bulk
├── group_invite.py         # Invite users to a group
├── spam_decline.py         # Decline spam join requests
├── dump_fb.py              # Scrape & export Facebook data
│
├── mabsic group finder/    # Group search & discovery module
│   └── ...
│
└── README.md

⚠️ Missing files: This repo does not yet have a requirements.txt, .env example, or LICENSE file. Adding these is a great first contribution — see Contributing.


⚙️ Requirements

  • Python 3.7 or higher → Download
  • Google Chrome (latest) → Download
  • ChromeDriver matching your Chrome version → Download

🛠️ Installation

Works on Windows, macOS, and Linux.

1. Clone the repo

git clone https://github.com/Mahdi-hasan-shuvo/Facebook-automation.git
cd Facebook-automation

2. Create a virtual environment (recommended)

# Create
python -m venv venv

# Activate — Windows:
venv\Scripts\activate

# Activate — macOS / Linux:
source venv/bin/activate

3. Install dependencies

pip install selenium beautifulsoup4 requests

4. Set up ChromeDriver

Option A — Automatic (easiest):

pip install webdriver-manager

Then in your script, replace the driver setup with:

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())

Option B — Manual:

  1. Check your Chrome version: chrome://settings/help
  2. Download the matching ChromeDriver from chromedriver.chromium.org
  3. Place it in your project folder or add it to your system PATH

⚙️ Configuration

Note: The repo does not yet include a .env file. Credentials are currently set directly inside each script.

Option A — Edit the script directly

Open any script and look for the config section near the top:

# ── CONFIG ──────────────────────────────────
EMAIL     = "[email protected]"
PASSWORD  = "your_password"
GROUP_URL = "https://www.facebook.com/groups/your-group-id"
# ────────────────────────────────────────────

Replace the values and save.

Option B — Use a .env file (recommended)

Create a .env file in the project root:

[email protected]
FB_PASSWORD=your_password
TARGET_GROUP=https://www.facebook.com/groups/your-group-id

Install python-dotenv:

pip install python-dotenv

Load it in your script:

from dotenv import load_dotenv
import os

load_dotenv()
email     = os.getenv("FB_EMAIL")
password  = os.getenv("FB_PASSWORD")
group_url = os.getenv("TARGET_GROUP")

🔒 Always add .env to .gitignore — never commit your password to GitHub.


▶️ Usage

Run any script individually from your terminal:

# Delete all posts in a group
python post_delete.py

# Leave groups in bulk
python group_leav.py

# Invite users to a group
python group_invite.py

# Decline spam join requests
python spam_decline.py

# Scrape and export Facebook data
python dump_fb.py

# Find Facebook groups by keyword
cd "mabsic group finder"
python main.py

Example output

[INFO] Opening Chrome...
[INFO] Logging in to Facebook...
[INFO] Login successful ✓
[INFO] Found 52 posts in group.
[INFO] Deleted post  1 / 52 ✓
[INFO] Deleted post  2 / 52 ✓
...
[INFO] All done! 52 posts deleted.

🔁 Scripts run continuously until the task is fully complete — perfect for large groups.


⚠️ Safety & Responsible Use

Please read before running any script.

  • 📖 Automating Facebook actions may violate Facebook's Terms of Service. Your account could be restricted or banned.
  • 👤 Only use these scripts on accounts you own.
  • 🐌 Do not remove built-in delays — they reduce the risk of triggering bot detection.
  • 🔒 Never commit your Facebook credentials to a public repository.
  • ⚖️ The author is not responsible for any account bans, data loss, or consequences of using this software.

Use it ethically, legally, and entirely at your own risk.


🤝 Contributing

Contributions of all kinds are welcome — bug fixes, new scripts, documentation, tests.

# 1. Fork the repo (click Fork at the top of this page)

# 2. Clone your fork
git clone https://github.com/YOUR-USERNAME/Facebook-automation.git
cd Facebook-automation

# 3. Create a branch
git checkout -b feature/your-feature-name

# 4. Make your changes, then commit
git add .
git commit -m "feat: describe what you changed"

# 5. Push and open a Pull Request
git push origin feature/your-feature-name

Good first contributions for beginners

  • Add a requirements.txt
  • Add a .gitignore file
  • Add a LICENSE file (MIT recommended)
  • Add code comments or docstrings to existing scripts
  • Write a new automation script
  • Add screenshots to this README

📄 License

⚠️ This repo does not currently include a LICENSE file.

Without a license, all rights are legally reserved by the author by default. Adding an MIT License is strongly recommended — it's the most permissive and widely used open-source license.

Suggested action: Create a LICENSE file in the root of the repo with the MIT License text.


Damo

image

📬 Contact

Have a question, found a bug, or want to collaborate on a paid project?

📩 Email [email protected]
💬 WhatsApp +8801616397082
🌐 Portfolio / Website mahdi-hasan-shuvo.github.io

⭐ Support This Project

If this project saved you time or helped you learn, a star costs nothing and means a lot:

Star this repo   Fork this repo   Watch for updates

📢 New automation scripts are added regularly — Watch the repo so you don't miss them!


Made with ❤️ | Please ⭐ Star & 🍴 Fork this project!

Built by Mahdi Hasan Shuvo · Open Source from Bangladesh 🇧🇩

Jelajahi proyek terkait

Memuat…