https://github.com/iikoshteruu/enhanced-grok-export
The first comprehensive open-source userscript for exporting Grok conversations with intelligent speaker detection, multi-format support, and seamless X.com integration. Production-ready with 90% accuracy.
https://github.com/iikoshteruu/enhanced-grok-export
export greasyfork grok speaker-detection tampermonkey userscript
Last synced: about 2 months ago
JSON representation
The first comprehensive open-source userscript for exporting Grok conversations with intelligent speaker detection, multi-format support, and seamless X.com integration. Production-ready with 90% accuracy.
- Host: GitHub
- URL: https://github.com/iikoshteruu/enhanced-grok-export
- Owner: iikoshteruu
- License: mit
- Created: 2025-05-25T21:02:45.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-11T09:26:29.000Z (5 months ago)
- Last Synced: 2026-01-11T14:50:50.031Z (5 months ago)
- Topics: export, greasyfork, grok, speaker-detection, tampermonkey, userscript
- Language: JavaScript
- Homepage: https://greasyfork.org/en/scripts/537266-enhanced-grok-export-v2-4
- Size: 1.32 MB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Enhanced Grok Export
[](https://github.com/iikoshteruu/enhanced-grok-export)
[](LICENSE)
[]([
[](https://github.com/iikoshteruu/enhanced-grok-export/releases/latest)
**The first comprehensive open-source userscript for exporting Grok conversations with intelligent speaker detection, multi-format support, and seamless X.com integration.**
> 🎉 **Production Ready!** All major bugs resolved, 90% speaker detection accuracy achieved, and 100% export reliability confirmed.
## 🚀 Features
- **🎯 Intelligent Speaker Detection** - 90% accuracy with optimal Human/Grok identification using advanced content analysis
- **📝 Multi-Format Export** - Choose from Markdown, Plain Text, JSON, PDF, or Share directly to X
- **🔄 Complete Conversation Loading** - Auto-scroll technology loads entire conversation history from X.com's dynamic interface
- **🎭 Grok Mode Preservation** - Maintains Think Mode, Fun Mode, and DeepSearch context with visual indicators
- **🐦 Share to X Integration** - Select conversation snippets with real-time character counting and hashtag suggestions
- **📊 Rich Metadata & Analytics** - Comprehensive conversation statistics, export timestamps, and performance metrics
- **🛡️ Privacy-First Design** - All processing happens locally in your browser with zero external data transmission
- **🖥️ Cross-Browser Compatible** - Works seamlessly with all major userscript managers on desktop browsers
## 📋 Export Formats
| Format | Best For | Features | Status |
|--------|----------|----------|--------|
| **📝 Markdown** | Documentation & Notes | Think Mode structure, mode indicators, link preservation | ✅ Perfect |
| **📄 Plain Text** | Simple Sharing | Clean flow, universal compatibility, mode context | ✅ Perfect |
| **📊 JSON Data** | Analysis & Processing | Complete metadata, speaker statistics, conversation analytics | ✅ Perfect |
| **📋 PDF Document** | Professional Reports | Formatted text with statistics, CSP-compliant generation | ✅ Working |
| **🐦 Share to X** | Social Media | Message selection, character counting, direct posting | ✅ Flawless |
### **Advanced Export Features**
- **Automatic file naming** with message counts and timestamps
- **Mode-specific formatting** preserves Think Mode reasoning and Fun Mode personality
- **Conversation statistics** including speaker distribution and mode analytics
- **Professional document structure** with headers, separators, and metadata tables
## 🛠 Installation
### **1. Install a Userscript Manager**
- **[Tampermonkey](https://www.tampermonkey.net/)** (Chrome, Firefox, Safari, Edge) - **Recommended**
- **[Greasemonkey](https://www.greasespot.net/)** (Firefox)
- **[Violentmonkey](https://violentmonkey.github.io/)** (Chrome, Firefox, Edge)
### **2. Install Enhanced Grok Export**
- **[Click here to install](enhanced-grok-export.user.js)** (GitHub direct)
- **- **[Install from Greasyfork](https://greasyfork.org/en/scripts/537266-enhanced-grok-export-v2-4)** (Community platform)
- Or copy the script code directly into your userscript manager
### **3. Start Using**
- Visit **[x.com/i/grok](https://x.com/i/grok)** and start a conversation
- The **🤖 Export Grok** button appears automatically in the bottom-right corner
## 🎯 Usage
### **Quick Start**
1. **Have a conversation** with Grok on X.com
2. **Click the 🤖 Export Grok button** in the bottom-right corner
3. **Choose your export format** from the elegant dropdown menu
4. **Download automatically** with descriptive filename and timestamp
### **Export Options**
- **📝 Markdown** - Perfect for GitHub, Notion, Obsidian, and documentation
- **📄 Plain Text** - Universal format for any text editor or platform
- **📊 JSON Data** - Structured data with complete metadata for analysis
- **📋 PDF Document** - Professional formatted document with conversation statistics
- **🐦 Share to X** - Select specific messages to share with commentary and hashtags
### **Advanced Features**
- **Debug Information** - Click "🔍 Debug Info" to see speaker detection statistics
- **Auto-scroll Loading** - Automatically loads complete conversation history
- **Mode Detection** - Identifies and preserves Think Mode, Fun Mode, and DeepSearch context
- **Smart Speaker Detection** - 90% accuracy distinguishing between Human and Grok messages
## 🎭 Grok Mode Support
### **🤔 Think Mode**
Advanced step-by-step reasoning preservation:
- **Logical structure maintained** - All reasoning steps preserved in order
- **Clear mode indicators** - Visual tags show when Think Mode was active
- **Complete context** - Intermediate thinking processes included in exports
### **😄 Fun Mode**
Personality and humor preservation:
- **Casual tone maintained** - Grok's wit and personality preserved in exports
- **Context indicators** - Shows when Fun Mode influenced responses
- **Emoji and style** - Visual elements and casual language preserved
### **🔍 DeepSearch Mode**
Real-time data and citations:
- **Source preservation** - Links to real-time data sources maintained
- **X.com integration context** - Social media references and citations preserved
- **External links** - Web sources and reference materials included
## 🔧 Technical Details
### **Intelligent Speaker Detection System**
Enhanced Grok Export uses advanced content analysis to achieve 90% speaker detection accuracy:
```javascript
// Multi-method detection strategies
- Content length analysis (Grok typically writes longer responses)
- Technical terminology detection (algorithms, implementations, troubleshooting)
- Conversation flow patterns (questions → answers, commands → explanations)
- Context-aware scoring (surrounding message analysis)
- Project-specific term recognition (Docker, requirements.txt, etc.)
- User command identification (terminal commands, file operations)
```
### **Speaker Distribution Results**
- **Typical conversation:** ~40% Human / 60% Grok (realistic AI interaction pattern)
- **Detection confidence:** 90% accuracy verified through manual testing
- **Pattern recognition:** Successfully identifies user commands, technical explanations, questions, and responses
### **Auto-Scroll Technology**
Handles X.com's dynamic message loading:
- **Intelligent loading** - Automatically scrolls to load complete conversation history
- **Progress indication** - Shows loading status during auto-scroll operations
- **Memory management** - Efficiently processes conversations of any length
- **UI preservation** - Maintains interface responsiveness during export
### **File Naming Convention**
Automatically generated descriptive filenames:
```
grok-FULL-conversation-271msgs-2025-05-26T14-30-45.md
grok-export-ThinkMode-42msgs-2025-05-26T15-45-22.json
grok-document-161msgs-2025-05-26T16-20-15.txt
```
## 🎨 Customization
### **Configuration Options**
The script can be customized by modifying the `CONFIG` object:
```javascript
const CONFIG = {
buttonText: '🤖 Export Grok', // Custom button text
formats: ['md', 'txt', 'json', 'pdf', 'share'], // Available formats
defaultFormat: 'md', // Default selection
autoScroll: true, // Auto-load full conversation
debug: true, // Enable debug logging
shareToX: {
maxLength: 280, // X character limit
hashtagSuggestions: ['#Grok', '#AI', '#XAI'] // Default hashtags
}
};
```
### **Advanced Settings**
- **Export formats** - Enable/disable specific export options
- **Auto-scroll behavior** - Customize conversation loading
- **Debug mode** - Toggle detailed logging for troubleshooting
- **Social sharing** - Customize hashtags and character limits
## 🐛 Known Issues & Fixes
For comprehensive bug tracking and resolutions, see **[BUGS.md](BUGS.md)**.
### **All Major Issues Resolved ✅**
- **Speaker Detection:** Achieved 90% accuracy with realistic distribution (v2.4)
- **PDF Export:** CSP-compliant document generation working (v2.1+)
- **Export Reliability:** 100% success rate across all formats (v2.1+)
- **Cross-browser Compatibility:** Verified on all major userscript managers (v1.0+)
### **Quick Troubleshooting**
- **Export button missing?** Refresh page and ensure userscript manager is active
- **Incorrect speaker labels?** Update to v2.4+ for optimal detection
- **Share to X character limit?** Use message preview to check count
- **PDF format question?** Generates formatted text due to X.com security restrictions
**Need help?** Use the "🔍 Debug Info" button for diagnostic information or [create an issue](https://github.com/iikoshteruu/enhanced-grok-export/issues/new).
## 🆚 Why Enhanced Grok Export?
### **🥇 First-of-Its-Kind**
- **Only comprehensive solution** - The first open-source Grok conversation export tool
- **Built specifically for Grok** - Optimized for X.com's interface and Grok's unique capabilities
- **No competition** - Unique offering in the open-source ecosystem
### **🎯 Grok-Optimized Features**
Unlike generic chat exporters, Enhanced Grok Export provides:
- **Mode preservation** - Maintains Think, Fun, and DeepSearch context across exports
- **X.com integration** - Preserves social media context, citations, and real-time data sources
- **Intelligent detection** - 90% accurate speaker identification using advanced content analysis
- **Social sharing** - Direct integration with X.com for sharing conversation highlights
### **🔒 Privacy-First Design**
- **Local processing** - All operations happen in your browser with zero external communication
- **No data collection** - Your conversations never leave your device
- **Open source transparency** - Full code visibility and community auditing
- **Security conscious** - Works within X.com's Content Security Policy restrictions
### **🚀 Professional Quality**
- **Production ready** - 100% export success rate with comprehensive testing
- **Enterprise features** - Rich metadata, conversation analytics, and professional formatting
- **Robust architecture** - Handles edge cases, UI changes, and various conversation types
- **Active development** - Continuous improvement with community feedback
## 🔮 Roadmap
### **🚀 Coming Soon (v2.5)**
- **📱 Mobile Browser Compatibility** - Enhanced support for mobile userscript managers
- **🎨 Custom Export Templates** - User-defined formatting and styling options
- **📊 Advanced Analytics** - Conversation insights, trends, and detailed statistics
- **🔍 Smart Search & Filter** - Export specific topics, dates, or conversation segments
### **🌟 Future Features (v3.0+)**
- **📦 Batch Operations** - Export multiple conversations simultaneously
- **☁️ Cloud Integration** - Direct export to Google Drive, Dropbox, OneDrive
- **🤖 AI Summarization** - Automatic conversation summarization and key points extraction
- **📱 Progressive Web App** - Standalone application for enhanced functionality
### **🔬 Research & Development**
- **🧠 Advanced AI Analysis** - Conversation pattern recognition and sentiment analysis
- **🔗 Platform Integration** - Connect with productivity tools and knowledge management systems
- **📈 Usage Analytics** - Anonymous analytics for feature prioritization and optimization
- **🌐 Multi-Language Support** - Internationalization for global user base
## 📜 Credits
- **🎯 Developer:** [iikoshteruu](https://github.com/iikoshteruu) - Complete design and implementation
- **💡 Inspiration:** Community need for Grok conversation preservation and analysis
- **🤝 Built for:** The growing X.com Grok community and AI conversation enthusiasts
- **🙏 Special Thanks:** Beta testers, issue reporters, and the open-source community
### **Development Journey**
- **7 versions** released with continuous improvements
- **4 critical bugs** systematically identified and resolved
- **Speaker detection accuracy** evolved from 15% to 90% through iterative refinement
- **Community-driven** improvements based on real user feedback and testing
## 📄 License
**MIT License** - Complete freedom to use, modify, and distribute!
See the [LICENSE](LICENSE) file for full legal details.
### **What You Can Do**
✅ **Commercial use** - Integrate into business workflows
✅ **Modification** - Customize for your specific needs
✅ **Distribution** - Share with teams and communities
✅ **Private use** - Use internally without restrictions
### **What We Ask**
- **Include license** - Keep attribution in copies
- **No liability** - We're not responsible for any issues
- **Community spirit** - Consider contributing improvements back
## 🔗 Links
- **🤖 Grok AI:** [x.com/i/grok](https://x.com/i/grok) - Primary Grok interface
- **🐦 X.com:** [x.com](https://x.com) - Social platform hosting Grok
- **📚 Userscript Guide:** [Userscript Beginners HOWTO](https://openuserjs.org/about/Userscript-Beginners-HOWTO)
- **🔧 Tampermonkey:** [tampermonkey.net](https://www.tampermonkey.net/) - Recommended userscript manager
- **🍴 Greasyfork:** [Enhanced Grok Export](https://greasyfork.org/en/scripts/537266-enhanced-grok-export-v2-4) - Community userscript platform
- **🐛 Report Issues:** [GitHub Issues](https://github.com/iikoshteruu/enhanced-grok-export/issues) - Bug reports and feature requests
- **💬 Discussions:** [GitHub Discussions](https://github.com/iikoshteruu/enhanced-grok-export/discussions) - Community conversation
- **📋 Changelog:** [CHANGELOG.md](CHANGELOG.md) - Complete version history
- **🐛 Bug Tracking:** [BUGS.md](BUGS.md) - Development journey and resolutions
## 🏆 Project Status
### **Current Version: 2.4.1 - Production Ready ✅**
**Enhanced Grok Export has achieved production-ready status with all major functionality working reliably:**
> **v2.4.1 Update (January 2025):** Fixed critical conversation detection failure caused by Grok's migration to Tailwind CSS. All selectors updated for the new UI.
- **✅ Speaker Detection:** 90% accuracy with realistic conversation distribution
- **✅ Export Formats:** 100% success rate across all 5 export options
- **✅ Social Integration:** Flawless Share to X functionality with character counting
- **✅ Cross-Browser Support:** Verified compatibility with all major userscript managers
- **✅ Documentation:** Comprehensive guides, troubleshooting, and development history
- **✅ Community Ready:** Professional open-source project ready for widespread adoption
### **Quality Metrics**
- **🎯 Detection Accuracy:** 90% speaker identification success rate
- **📊 Export Success:** 100% reliability across all formats and conversation lengths
- **🔄 Uptime:** No known blocking issues or critical failures
- **🌐 Compatibility:** Works on Chrome, Firefox, Edge, Safari with userscript managers
- **📱 Platform Support:** X.com and Grok.com interfaces fully supported
### **Community Impact**
- **🚀 First-of-its-kind** comprehensive Grok export solution
- **🎯 Production quality** with enterprise-grade features and documentation
- **🤝 Open source** enabling community contributions and customization
- **🔒 Privacy-focused** with local processing and zero data collection
- **📈 Continuous improvement** through systematic development and user feedback
---
*Made with ❤️ for the X.com Grok community • Star ⭐ this repo if it helps you!*
**Ready to preserve your AI conversations? Install Enhanced Grok Export today! 🚀**