How shihab-miah/facebook-automatic-ai-news-scrapper---publisher works
1. What this repo is
- The repository is structured as a single automation pipeline plus supporting documentation/assets.
- The intended behavior, per the README, is: scrape news → rewrite headline with AI → publish to a Facebook Page.
2. Core executable boundary
- The only source file in the tree is src/main.gs, so the runtime appears to center on one main script entrypoint rather than a multi-service application.
- There is no visible package manifest, service directory, or separate backend/frontend split in the tree.
3. Primary data flow
- The pipeline is linear:
- collect content from news sources,
- transform it with an AI model,
- send the generated post to Facebook.
- The main architectural value is in this content-processing chain, not in user interaction or persistent storage.
4. Content ingestion subsystem
- The README describes multi-source scraping from configurable news sites.
- This is the first external boundary: the repo consumes public web content and extracts article links/headlines before any AI or publishing step.
5. AI rewriting subsystem
- The second boundary is the headline generation/rewrite step using GPT-2 via Hugging Face Transformers as described in the README.
- Architecturally, this acts as a transformation layer between raw scraped content and the publishable Facebook post text.
6. Publishing subsystem
- The output boundary is the Facebook Graph API, which posts to a Facebook Page rather than a personal profile.
- The repository treats publishing as an automated API integration, not a manual review workflow.
7. Execution and scheduling
- The README places the bot under GitHub Actions, which means the repo is designed to run on a schedule and/or manual workflow dispatch in GitHub’s CI environment.
- That makes GitHub Actions the orchestrator, while the script itself is the worker logic.
8. Secrets and configuration boundary
- The repo depends on four runtime secrets:
- FB_EMAIL
- FB_PASSWORD
- PAGE_ID
- ACCESS_TOKEN
- These are kept in GitHub Secrets, so credentials are injected at runtime rather than stored in source.
9. Supporting documentation and assets
- docs/setup_guide.md likely contains operational setup instructions.
- assets/screenshots is documentation support only; it does not appear to participate in runtime behavior.
- These files are part of the onboarding/usage layer, not the core automation path.
10. Important architecture note
- There is a clear mismatch between the README and the file tree: the README describes a Python/Playwright/Transformers project, but the repo tree shows a .gs script, which strongly suggests Google Apps Script or at least a non-Python implementation.
- For an architecture diagram, treat the README as the stated target architecture and src/main.gs as the single implementation entrypoint, but note that the documentation and code structure are not fully aligned.
Main entry points: main.gs Main script · README.md README · setup_guide.md Setup guide · screenshots Screenshots
Components 15
Automation runtime
Scheduled execution and the main script that runs the news-to-Facebook pipeline.
- GitHub Actions · CI scheduler and manual runner that triggers the automation workflow.
- Main script · Single implementation entrypoint for the automation logic.
src/main.gs - News sources · Configured external sites that provide articles and headlines.
- Scrape news · Collects links and headline data from public news pages.
- Clean text · Prepares scraped content for downstream rewriting.
- GPT-2 · Language model used for headline rewriting.
- Transformers · Hugging Face runtime described in the README for model inference.
- Rewrite headline · Generates a publishable Facebook-style headline from scraped news content.
- Compose post · Builds the final post text sent to Facebook.
- Facebook Graph · Graph API boundary used to publish to a Facebook Page.
- Facebook Page · The page receiving automated posts.
- Secrets · Runtime credentials injected through GitHub Secrets: FB_EMAIL, FB_PASSWORD, PAGE_ID, ACCESS_TOKEN.
Support files
Documentation and assets that explain or illustrate the workflow.
- README · Stated project behavior and setup summary; describes the intended automation pipeline.
README.md - Setup guide · Operational setup instructions for running the automation.
docs/setup_guide.md - Screenshots · Illustrative images supporting the documentation.
assets/screenshots
Connections 16
- README → GitHub Actions: describes · The README documents scheduled GitHub Actions execution.
- README → Main script: points to · The README explains the single-script workflow.
- README → Setup guide: references · Operational setup is documented separately.
- Setup guide → Secrets: configures · Setup requires injecting runtime credentials.
- GitHub Actions → Main script: runs · GitHub Actions invokes the main automation script.
- Main script → News sources: reads from · The script starts by pulling content from news sources.
- News sources → Scrape news: feeds · Source sites are collected and parsed into article data.
- Scrape news → Clean text: cleans · Scraped data is normalized before AI rewriting.
- Clean text → Transformers: uses · Normalized text is prepared for model inference.
- Transformers → GPT-2: hosts · Transformers runtime provides the GPT-2 model layer.
- GPT-2 → Rewrite headline: generates · The model rewrites or generates the headline text.
- Rewrite headline → Compose post: formats · Rewritten text is packaged into a publishable post.
- Compose post → Facebook Graph: publishes to · Final post content is sent through the Facebook Graph API.
- Facebook Graph → Facebook Page: posts on · The API boundary targets a Facebook Page.
- Secrets → Main script: injects · Credentials and IDs are provided to the runtime at execution time.
- Screenshots → Setup guide: illustrates · Screenshots support the onboarding documentation.