# DIDI Content Extractor - Browser Extension Professional browser extension for extracting structured content from social media posts. ## 🎯 Features ### Platform-Specific Extraction - **Facebook**: Clean extraction with intelligent text filtering and primary image detection - **Twitter/X**: Tweet-specific extraction with proper content identification - **LinkedIn**: Coming soon - **Custom Websites**: Future OCR-based extraction ### Smart Content Detection - **Post Container Detection**: Walks DOM tree to find exact post boundaries - **Author Extraction**: Multiple selector patterns for reliable author identification - **Text Filtering**: Removes UI noise (Like, Comment, Share buttons, etc.) - **Primary Image**: Extracts main image only (200x200px minimum, excludes icons/emojis/profile pics) - **Metadata**: Timestamp and post URL extraction ### Content Types - `text` - Text only posts - `image` - Image only posts - `text+image` - Combined content posts - `text+video` - Coming soon - `video` - Coming soon ## 📦 Installation 1. Open Chrome/Edge and navigate to `chrome://extensions` 2. Enable **Developer mode** (top right toggle) 3. Click **Load unpacked** 4. Select the `browser-extension` folder 5. Extension installed! ## 🚀 Usage ### Facebook Extraction 1. Navigate to Facebook 2. Click extension icon 3. Click **"Activate Selection Mode"** under Facebook tab 4. Hover over any post (entire post highlighted with blue border) 5. Click to extract content 6. View extracted content in popup 7. Click **"💾 Save"** to store for later ### Twitter/X Extraction 1. Navigate to Twitter/X 2. Click extension icon 3. Click **"Activate Selection Mode"** under X/Twitter tab 4. Hover over any tweet (entire tweet highlighted) 5. Click to extract content 6. View and save as above ### Saved Extractions - Switch to **"Saved"** tab to view all saved content - **"👁️ View"** - View full details - **"📋 Copy"** - Copy JSON to clipboard - **"🗑️ Delete"** - Delete individual item - **"Clear All"** - Remove all saved extractions ## 📊 Data Structure ```javascript { platform: 'facebook' | 'twitter', type: 'text' | 'image' | 'text+image', author: 'Author Name', text: 'Post content...', image: { url: 'https://...', width: 1200, height: 800, alt: 'Description' }, timestamp: '2024-01-15T10:30:00', postUrl: 'https://facebook.com/...', extractedAt: '2024-01-15T10:35:00.000Z' } ``` ## 🏗️ Architecture ### Platform Extractors #### FacebookExtractor - **Post Detection**: `[role="article"]` containers - **Author**: `h2 a[role="link"]`, `h3 a[role="link"]` - **Text**: `div[dir="auto"][style*="text-align"]` with UI noise filtering - **Image**: Primary image detection (excludes icons/emoji/profiles) - **Metadata**: Timestamp from `a[aria-label*="ago"]`, URL from permalinks #### TwitterExtractor - **Tweet Detection**: `article[data-testid="tweet"]` containers - **Author**: `[data-testid="User-Name"] span` - **Text**: `[data-testid="tweetText"]` - **Image**: `[data-testid="tweetPhoto"] img` - **Metadata**: Timestamp from `