Skip to content

patocabo/XNotionhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

X to Notion Chrome Extension

Save tweets from X (Twitter) directly to your Notion database with AI-powered categorization and summarization.

Chrome Extension Notion API OpenAI GPT-5

โœจ Features

  • ๐Ÿ“Œ Individual Save Buttons - Save button on each post for precise control
  • ๐Ÿค– AI-Powered Processing - Automatic summarization and categorization using GPT-5 nano
  • ๐Ÿท๏ธ Smart Titles - Generates concise 3-5 word titles instead of long sentences
  • ๐Ÿ“‚ Dynamic Categories - Syncs categories directly from your Notion database
  • โšก Real-time Feedback - Visual indicators for save status
  • ๐Ÿ”„ Batch Support - Save multiple posts quickly
  • ๐Ÿ’พ Works Offline - Posts saved even if AI processing fails

๐Ÿ“‹ Prerequisites

  • Google Chrome browser
  • Notion account with an integration token
  • OpenAI API key (optional, for AI features)

๐Ÿš€ Installation

Step 1: Clone the Repository

git clone https://github.com/yourusername/NotionHook.git
cd NotionHook

Note: No build process or npm install required! The extension is ready to use immediately.

Step 2: Load the Extension in Chrome

  1. Open Chrome and navigate to chrome://extensions/
  2. Enable Developer mode (toggle in top right)
  3. Click Load unpacked
  4. Select the x-to-notion-extension folder from the cloned repository

Step 3: Configure Notion Integration

  1. Go to Notion Integrations
  2. Click New integration
  3. Name it (e.g., "X to Notion")
  4. Select your workspace
  5. Click Submit
  6. Copy the Internal Integration Token

Step 4: Set Up Your Notion Database

Option A: Create a New Database

  1. Click the extension icon and go to Options
  2. Paste your Notion integration token
  3. Choose Create New Database
  4. Provide a parent page URL where the database should be created
  5. Click Create Database

Option B: Use an Existing Database

  1. Open your existing Notion database
  2. Click Share โ†’ Invite โ†’ Search for your integration name
  3. Copy the database URL
  4. In extension Options, choose Use Existing Database
  5. Paste the database URL

Step 5: Configure AI Features (Optional)

  1. Get an API key from OpenAI Platform
  2. In extension Options, toggle Enable AI Processing
  3. Enter your OpenAI API key
  4. Click Save Settings

๐Ÿ“Š Notion Database Properties

The extension will automatically create or use these properties:

Required Properties

  • Title (title) - Concise post title
  • Tweet Text (rich_text) - Full post content
  • Username (rich_text) - Author's display name
  • Handle (rich_text) - Author's @handle
  • Tweet URL (url) - Link to original post
  • Tweeted At (date) - Post timestamp
  • Saved At (date) - When you saved it

AI-Enhanced Properties (Optional)

  • AI Summary (rich_text) - 2-3 sentence summary
  • Category (select) - Automatic categorization
  • Keywords (multi_select) - Extracted topics
  • Sentiment (select) - Positive/Negative/Neutral
  • AI Processed (checkbox) - Whether AI was used

๐ŸŽฏ Usage

Saving Posts

  1. Navigate to X.com (Twitter)
  2. Look for the Save button in each post's action bar
  3. Click Save to send the post to your Notion database
  4. Button changes to Saved when successful

Managing Categories

  1. In Notion: Add/edit options in the "Category" select field
  2. In Extension: Click "Sync from Notion" in Options to update
  3. AI will only use categories that exist in your database

Customizing AI Behavior

The extension uses:

  • GPT-5 nano for fast, efficient processing
  • Minimal reasoning for quick responses
  • Smart title generation (3-5 words)
  • Your custom categories from Notion

โš™๏ธ Configuration Options

Setting Description Required
Notion Token Your integration token โœ… Yes
Database ID Target database for posts โœ… Yes
OpenAI API Key For AI features โŒ Optional
AI Processing Toggle AI features on/off โŒ Optional
Categories Managed in Notion database โŒ Optional

๐Ÿ”ง Development

Project Structure

NotionHook/
โ”œโ”€โ”€ x-to-notion-extension/
โ”‚   โ”œโ”€โ”€ manifest.json           # Extension configuration
โ”‚   โ”œโ”€โ”€ background/
โ”‚   โ”‚   โ”œโ”€โ”€ service-worker.js   # Main extension logic
โ”‚   โ”‚   โ””โ”€โ”€ openai-service.js   # AI integration
โ”‚   โ”œโ”€โ”€ content/
โ”‚   โ”‚   โ””โ”€โ”€ x-scraper.js        # X.com integration
โ”‚   โ”œโ”€โ”€ options/                # Settings page
โ”‚   โ”œโ”€โ”€ popup/                  # Extension popup
โ”‚   โ””โ”€โ”€ icons/                  # Extension icons
โ””โ”€โ”€ README.md

No Build Required!

This extension is completely self-contained:

  • โœ… No npm install needed - All code is vanilla JavaScript
  • โœ… No build process - Works directly in Chrome
  • โœ… No webpack/bundling - OpenAI integration is built-in
  • โœ… Ready to use - Just load in Chrome and go!

Key Features Implementation

  • Direct API integration - Uses Notion and OpenAI APIs directly
  • Smart caching - Reduces API calls and improves performance
  • Error resilience - Graceful degradation when services fail
  • Vanilla JavaScript - No framework dependencies

๐Ÿ› Troubleshooting

Extension Not Working?

  1. Reload the extension in chrome://extensions/
  2. Refresh the X.com page (F5)
  3. Check the browser console for errors (F12 โ†’ Console)

Posts Not Saving?

  1. Verify your Notion token is correct
  2. Ensure database is shared with integration
  3. Check if database has required properties
  4. Try disabling AI features temporarily

AI Features Not Working?

  1. Verify OpenAI API key is valid
  2. Check you have API credits available
  3. Ensure "Enable AI Processing" is checked
  4. Categories must exist in Notion database

Categories Not Syncing?

  1. Ensure your database has a "Category" select field
  2. Add options to the Category field in Notion
  3. Click "Sync from Notion" in Options
  4. Check console for sync errors

๐Ÿ“„ License

MIT License - feel free to use and modify!

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“ฎ Support

If you encounter any issues or have questions:

  • Open an issue on GitHub
  • Check existing issues for solutions
  • Include console logs when reporting bugs

๐Ÿ™ Acknowledgments

  • Built with Chrome Extensions Manifest V3
  • Powered by Notion API
  • AI features using OpenAI GPT-5 nano
  • Inspired by the need for better tweet organization

Note: This extension is not affiliated with X (Twitter), Notion, or OpenAI. It's an independent tool to improve your workflow.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors