An automated application for posting Quran pages and Hadith content to Facebook groups. This bot helps spread Islamic knowledge by systematically sharing Quran pages and authentic Hadith across multiple Facebook groups. Once configured, it will automatically post to all your specified groups based on your schedule (hourly, daily, or any custom interval you set using cron expressions).
This application leverages the Fewfeed Chrome Extension to automate the posting process. Here's how it works:
- The app uses Puppeteer to control a Chrome browser instance with the Fewfeed extension installed
- It automatically logs into your Facebook account (using either credentials or cookies)
- For each posting cycle:
- Selects a random Quran page from the
quran-imagesdirectory. - Fetches a random Hadith from the Hadith API
- Uses Fewfeed's functionality to post this content to your configured Facebook groups
- Selects a random Quran page from the
- The entire process runs automatically based on your configured schedule (CRON_SCHEDULE)
- In development mode (HEADLESS=false), you can watch the automation process in action
- 🕌 Random Quran pages with proper formatting
- 📚 Random Hadith selection from verified sources
- 👥 Automated posting to multiple Facebook groups
- ⏰ Configurable posting schedule using cron expressions
- 🔄 Automatic session management and login handling
- 🛡️ Error handling and retry mechanisms
- Node.js >= 18.0.0
- A valid Facebook account
Create a .env file in the root directory with the following variables:
FB_EMAIL=your-facebook-email
FB_PASSWORD=your-facebook-password
CRON_SCHEDULE=* * * * * # Cron schedule for posting (e.g., "0 * * * *" for hourly, "0 0 * * *" for daily)
NODE_ENV=production # or development
FACEBOOK_COOKIES=[] # Array of Facebook session cookies (required for production, leave empty for development)
HEADLESS=true # Set to false if you want to see the browser automation process (must be true in production)-
Clone the repository:
git https://github.com/XredaX/Quran-Hadith-Poster.git cd Quran-Hadith-Poster -
Install dependencies:
npm install
-
Set up your environment variables in
.envfile -
Run the application:
node index.js
.
├── index.js # Main application file
├── fewfeed/ # extension directory, used to post to groups
├── quran-images/ # Directory containing Quran page images
├── cookies.json # Facebook session cookies (first time login by email & password, then save to this file)
├── .env # Environment variables
└── Dockerfile # Dockerfile for building the application, so you can easy deploy it to Railway or any other platform
Contributions are welcome! Please feel free to submit a Pull Request.
Feel free to reach out if you have any questions or suggestions:
- LinkedIn: Reda El Bettioui
- Email: redaelbettioui@gmail.com
The Quran pages images used in this project are sourced from:
- Quran Pages Images Repository by zeyadetman
The Hadith content is carefully selected from authentic sources using the Hadith API
The automation is powered by Fewfeed - a powerful Chrome extension for automated Facebook group posting