57 lines
1.6 KiB
Markdown
57 lines
1.6 KiB
Markdown
# Facebook to RSS Scraper
|
|
|
|
This tool scrapes public posts from a Facebook page and converts them into an RSS feed (.xml). It can be run locally or automated using GitHub Actions.
|
|
|
|
## Prerequisites
|
|
|
|
- Python 3.9+
|
|
- pip (Python package installer)
|
|
|
|
## Local Installation & Usage
|
|
|
|
1. **Clone the repository:**
|
|
```bash
|
|
git clone <repository-url>
|
|
cd fb-rss-bridge
|
|
```
|
|
|
|
2. **Install dependencies:**
|
|
It is recommended to use a virtual environment.
|
|
```bash
|
|
python3 -m venv .venv
|
|
source .venv/bin/activate
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
3. **Run the scraper:**
|
|
```bash
|
|
python3 main.py <page_name>
|
|
```
|
|
|
|
Replace `<page_name>` with the Facebook page ID or username.
|
|
|
|
**Options:**
|
|
- `--output`: Specify output file name (default: `feed.xml`)
|
|
- `--pages`: Number of pages to scrape (default: 1)
|
|
|
|
**Example:**
|
|
```bash
|
|
python3 main.py GitHub --pages 2 --output github_feed.xml
|
|
```
|
|
|
|
## GitHub/Gitea Actions Automated Feed (Free Cloud Solution)
|
|
|
|
This repository is configured to run automatically on GitHub's free tier for public repositories.
|
|
|
|
1. **How it works:**
|
|
- The `.gitea/workflows/update_feed.yml` file defines a "cron job" that runs every 6 hours.
|
|
- It spins up a temporary server (runner), installs Python, runs the script, and saves the `feed.xml` back to your code.
|
|
- This entire process is free for public repositories on GitHub.
|
|
|
|
2. **Configuration:**
|
|
The workflow is scheduled to run every 6 hours. You can customize the target Facebook page in `.gitea/workflows/update_feed.yml`:
|
|
```yaml
|
|
env:
|
|
FB_PAGE: "GitHub" # Change this to the desired page ID/username
|
|
```
|