Skip to content

MoYuM/notion2rss

Repository files navigation

Notion2RSS

🌐 English | 简体中文

Notion2Rss converts your Notion database into a subscribable RSS feed using Cloudflare Workers.

🚀 Getting Started

Prerequisites

  • A Cloudflare account
  • A GitHub account
  • Connect Cloudflare to your GitHub account

Step 1: Create a Worker

  1. Go to the Cloudflare Workers dashboard and click "Import from GitHub"

    image

  2. Choose "Clone a Git repository via URL"

    image

  3. Enter the repository URL:

    https://github.com/MoYuM/notion2rss
    

    image

  4. Customize your Worker and KV namespace name (optional), or simply proceed to the next step

    image

  5. Wait for the Worker to build and deploy successfully

Step 2: Set Up Notion Token

  1. Go to the settings page of the newly created Worker, and add an environment variable: Name: N2R_NOTION_TOKEN, Type: Secret

    image

  2. Click Deploy to apply the environment variable

    image

Step 3: Access Your RSS Feed

  1. Visit your Worker URL to access the RSS feed in XML format. Note: The first load may be slow, but subsequent requests will be faster.

⚙️ RSS Configuration

You can customize your RSS feed (e.g., title, icon, author) using environment variables.

To configure them, go to your Worker's settings page and edit the variables section:

image

Example configuration:

{
  "vars": {
    // Notion database ID to convert to RSS
    "N2R_NOTION_DATABASE_ID": "1e6e29bd912180839a35d7dab1e45e66",

    // URL of your Notion blog or site
    "N2R_SITE_URL": "https://moyum.notion.site/moyum-130e29bd912180f7bee6c01cc2b09017",

    // URL of the generated RSS feed
    "N2R_FEED_URL": "https://notion2rss-worker.moyum.workers.dev",

    // Feed title
    "N2R_TITLE": "Moyum's Blog",

    // Language code
    "N2R_LANGUAGE": "zh-CN",

    // Author name
    "N2R_AUTHOR": "moyum",

    // Feed description
    "N2R_DESCRIPTION": "A developer who wants to build interesting things",

    // Feed image/icon
    "N2R_IMAGE_URL": "https://i.imgur.com/7WJRaSx.jpeg"
  }
}

🛠️ Local Development

  1. Create a .dev.vars file in the root directory with your Notion token:
N2R_NOTION_TOKEN="your notion token"
  1. Install dependencies and start the dev server:
npm install
npm run dev

Feel free to open issues or submit pull requests to improve this project! 🎉

About

Convert your Notion database into an RSS feed using Cloudflare Workers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published