WeRSS - WeChat Official Account RSS Subscription Assistant

repository·main·Indexed 26 days ago

https://github.com/rachelos/we-mp-rss

A tool to scrape, parse, and generate RSS feeds from WeChat Official Accounts. It includes a web management interface, scheduled updates, custom HTML filtering, and a FastAPI-based web preview module. The project also features qtserver-mqtt (v1.0.0), a Node.js-based MQTT server supporting MQTT 3.1.1 and WebSocket connections.

Tokens
28.4K
Snippets
83
Records
176
Agent score
87%

What's inside WeRSS

  1. Overview of WeRSS Web Preview Module

    main
    The WeRSS Web Preview Module provides a FastAPI-based web interface for viewing WeChat Official Account articles. It features a responsive, card-based UI designed for both desktop and mobile devices, utilizing a modern gradient theme and CSS Grid/Flexbox layouts.
  2. Configure the WeRSS Cascade System (Parent and Child Nodes)

    main

    The WeRSS Cascade system uses a parent-child architecture to distribute data management and task execution.

    Parent Node Configuration

    By default, the parent node runs in independent mode. To ensure it is configured as a parent, use the following settings in config.yaml or via environment variables:

    YAML (config.yaml):

    cascade:
      enabled: False
      node_type: parent

    Environment Variables: CASCADE_ENABLED=False

    Child Node Configuration

    Child nodes must be configured to connect to a parent node to pull data and report results. You can configure them via config.yaml or environment variables.

    YAML (config.yaml):

    cascade:
      enabled: True
      node_type: child
      parent_api_url: "http://parent-server:8001"
      api_key: "CNxxxxx"
      api_secret: "CSxxxxx"
      sync_interval: 300
      heartbeat_interval: 60

    Environment Variables:

    CASCADE_ENABLED=True
    CASCADE_NODE_TYPE=child
    CASCADE_PARENT_URL=http://parent-server:8001
    CASCADE_API_KEY=CNxxxxx
    CASCADE_API_SECRET=CSxxxxx
    CASCADE_SYNC_INTERVAL=300
    CASCADE_HEARTBEAT_INTERVAL=60
    # config.yaml for Child Node
    cascade:
      enabled: True
      node_type: child
      parent_api_url: "http://parent-server:8001"
      api_key: "CNxxxxx"
      api_secret: "CSxxxxx"
      sync_interval: 300
      heartbeat_interval: 60
  3. Verify cascade configuration and connectivity

    main

    After configuring, use these three methods to verify your setup:

    1. Run diagnostics: python diagnose_config.py (should output ✓ URL格式正确)
    2. Test initialization: python test_cascade_init.py (should output ✓ 级联客户端初始化成功)
    3. Test connection via curl: Manually test the heartbeat endpoint using the credentials obtained from the parent server.
    # Test heartbeat connection
    curl -X POST "http://parent:8001/api/v1/cascade/heartbeat" \
      -H "Authorization: AK-SK CNxxx:CSxxx"
  4. Enable Debug Mode for Web Development

    main

    When developing the web interface, you can run the application with uvicorn in reload mode to automatically apply changes to the FastAPI application.

    # In a development environment
    import uvicorn
    uvicorn.run("web:app", host="0.0.0.0", port=8001, reload=True)
  5. Configure scheduled tasks (Cron jobs)

    main

    To enable and manage scheduled tasks:

    1. Enable the job: Set ENABLE_JOB to True in config.yaml or via the ENABLE_JOB environment variable.
    2. Set interval: Adjust the task frequency using the interval key in config.yaml or the SPAN_INTERVAL environment variable.
    3. Add tasks: Use the UI under 「消息任务」 (Message Tasks) to add specific scheduled tasks.
  6. Install and Run Backend Service (Development)

    main

    To run the backend in a development environment, ensure you have Python >= 3.13.1 installed.

    1. Clone the repository:
      git clone https://github.com/rachelos/we-mp-rss.git
      cd we-mp-rss
    2. Install dependencies:
      pip install -r requirements.txt
    3. Configure the database by copying the example config:
      cp config.example.yaml config.yaml
    4. Start the service:
      python main.py -job True -init True
  7. Deploy a Parent Node (Main Server)

    main

    To set up a Parent Node, follow these steps:

    1. Initialize the database: Ensure your config.yaml has the correct database path (e.g., db: sqlite:///data/db.db) and run the initialization script.
    2. Create child nodes: Use the cascade_init.py script to generate credentials for new child nodes. Note: Save the outputted API Key and API Secret immediately, as they are only displayed once.
    3. Start the service: Run the main application.

    Once running, the parent node manages official accounts, tasks, and aggregates results from all connected child nodes.