Skip to content

Weekly Journal Extractor extracts journal entries from Notion.

Notifications You must be signed in to change notification settings

Enhso/weekly-journal-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weekly Journal Extractor

This project is a TypeScript-based tool that extracts journal entries from a Notion database for the past 7 days and saves them into a structured XML file.

Features

  • Connects to Notion using the official API.
  • Queries entries created in the last 7 days.
  • Extracts text content from paragraph blocks.
  • Formats output as XML with date-based IDs.

Prerequisites

  • Node.js installed on your machine.
  • A Notion Integration Token (API Key).
  • The ID of the Notion database you want to extract from.

Setup

  1. Install dependencies:

    npm install
  2. Configure Environment Variables:

    Create a .env file in the root directory with the following variables:

    NOTION_API_KEY=your_notion_integration_token
    NOTION_PAGE_ID=your_notion_database_id
    OUTPUT_PATH=./journal_entries.xml

    Note: Ensure your Notion Integration has access to the target database.

Usage

Run the extraction script using tsx:

npx tsx extract.ts

Output Format

The script generates an XML file (specified by OUTPUT_PATH) with the following structure:

<entry id="2023-10-27">
Content of the journal entry...
</entry>

<entry id="2023-10-28">
Another entry content...
</entry>

About

Weekly Journal Extractor extracts journal entries from Notion.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published