Transform your X (Twitter) presence with AI-powered magical content creation!
Xvitz is a sophisticated AI-powered application that automatically generates engaging, viral-worthy content for X (Twitter) using the magical Xvitz AI agent from the realm of Moscownpur. Create compelling tweets with just one click!
- One-Click Content Creation: Generate and post tweets automatically
- AI-Powered Content: Uses Groq's Llama-3.3-70b model for high-quality content
- Multiple Content Categories: Creative, Writing, Moscownpur, and Random themes
- Custom Prompts: Write your own prompts for specific content needs
- Memory System: Maintains conversation context (last 5 interactions)
- Beautiful UI: Modern, responsive web interface with magical design
- Real-time Feedback: See exactly what was generated and posted
- Personality: Engaging, interactive, witty, and trend-aware
- Specialization: Optimized for X (Twitter) content creation
- Memory: Maintains conversation history for contextual responses
- Token Limit: 200 tokens per response for Twitter-friendly content
- Website Integration: Naturally promotes www.moscownpur.in
- Creative: Storytelling, worldbuilding, character creation
- Writing: Writing prompts, overcoming writer's block, inspiration
- Moscownpur: Magical realm, creative tools, community features
- Random: Mixed creative prompts for variety
- Node.js (v14 or higher)
- Twitter Developer Account with API access
- Groq API key
-
Clone the repository
git clone <repository-url> cd X
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:# Twitter API Credentials (OAuth 1.0a) TWITTER_APP_KEY=your_twitter_app_key TWITTER_APP_SECRET=your_twitter_app_secret TWITTER_ACCESS_TOKEN=your_twitter_access_token TWITTER_ACCESS_SECRET=your_twitter_access_secret # Groq API Key GROQ_API_KEY=your_groq_api_key # Optional: Proxy Configuration HTTP_PROXY=your_proxy_url # Optional: Bearer Token (comment out if using OAuth 1.0a) # TWITTER_BEARER_TOKEN=your_bearer_token
-
Start the application
node Xvitz.js
-
Open your browser Navigate to
http://localhost:5174
- Choose a Category: Select from Random, Creative, Writing, or Moscownpur
- Custom Prompt (Optional): Write your own prompt for specific content
- Generate Content: Click "Generate Content" to preview
- Auto Post: Click "Auto Post to X" to create and post immediately
GET /generate?category=creative
GET /generate?prompt=Create a viral tweet about magicGET /auto-tweet?category=writing
GET /auto-tweet?prompt=Write about creativityGET /post?text=Your custom tweet textGET /test-xvitz?prompt=Hello Xvitz!GET /memory # View memory
GET /clear-memory # Clear memoryGET /health # Health check
GET /diagnose # System diagnosticsX/
├── Xvitz.js # Main application server
├── social-agents.js # AI agent definitions
├── public/
│ └── index.html # Web interface
├── package.json # Dependencies
├── .env # Environment variables
└── README.md # This documentation
- Express.js web server
- Twitter API integration
- Xvitz agent initialization
- Content generation and posting logic
- Static file serving
BaseSocialAgent: Base class with common functionalityXAgent: Specialized for X (Twitter) content- Memory management (last 5 messages)
- 200-token output limit
- Platform-specific personality
- Modern, responsive design
- Real-time content generation
- Category selection
- Custom prompt input
- Status feedback and animations
-
Create a Twitter Developer Account
- Visit Twitter Developer Portal
- Apply for a developer account
- Create a new app
-
Get API Credentials
- App Key and App Secret
- Access Token and Access Secret
- Enable Read and Write permissions
-
Environment Variables
TWITTER_APP_KEY=your_app_key TWITTER_APP_SECRET=your_app_secret TWITTER_ACCESS_TOKEN=your_access_token TWITTER_ACCESS_SECRET=your_access_secret
-
Get Groq API Key
- Visit Groq Console
- Create an account
- Generate an API key
-
Environment Variable
GROQ_API_KEY=your_groq_api_key
HTTP_PROXY=https://your-proxy-server:portEdit the CONTENT_PROMPTS object in Xvitz.js:
const CONTENT_PROMPTS = {
// ... existing categories
newCategory: [
"Prompt 1 for new category",
"Prompt 2 for new category",
"Prompt 3 for new category"
]
};Edit the buildMessages method in XAgent class in social-agents.js:
buildMessages(userMessage) {
const systemPrompt = `You are Xvitz, [your custom personality description]...`;
// ... rest of the method
}Modify the maxTokens property in the agent classes:
class XAgent extends BaseSocialAgent {
constructor() {
super("Xvitz", "X (Twitter)", "personality");
this.maxTokens = 300; // Change from 200 to desired limit
}
}- Cause: Twitter API permissions or authentication issues
- Solution:
- Ensure OAuth 1.0a credentials are correct
- Comment out
TWITTER_BEARER_TOKENin.env - Verify app has Read and Write permissions
- Cause: Invalid API credentials
- Solution:
- Check all Twitter API credentials in
.env - Ensure credentials are not expired
- Verify app permissions
- Check all Twitter API credentials in
- Cause: Invalid or missing API key
- Solution:
- Verify
GROQ_API_KEYin.env - Check Groq account status and credits
- Verify
- Cause: Invalid proxy configuration
- Solution:
- Verify proxy URL format
- Test proxy connectivity
- Remove proxy if not needed
Use these endpoints to diagnose issues:
# Check system health
curl http://localhost:5174/health
# View system diagnostics
curl http://localhost:5174/diagnose
# Test Xvitz agent
curl http://localhost:5174/test-xvitz
# View memory state
curl http://localhost:5174/memory{
"success": true,
"generatedContent": "🌟💡 Inspiration strike! 🚀 Found it in a sunset, a convo with a stranger, or a random dream? 🌅🗣️🌃 Share your weirdest & most wonderful sources of inspiration with me! 📝💬 #InspirationAnywhere #Moscownpur #CreativeSpark 🚀✨ Explore more sparks at www.moscownpur.in 🌐💫",
"prompt": "Create a tweet about finding inspiration in everyday life",
"category": "writing",
"xvitzMemory": 5
}{
"success": true,
"tweet": {
"data": {
"id": "1960278433818173700",
"text": "🌟💡 Inspiration strike! 🚀 Found it in a sunset..."
}
},
"generatedContent": "🌟💡 Inspiration strike! 🚀 Found it in a sunset...",
"prompt": "Create a tweet about finding inspiration in everyday life",
"category": "writing",
"xvitzMemory": 5
}- Never commit
.envfiles to version control - Use strong, unique API keys
- Rotate credentials regularly
- Twitter API: 300 tweets per 3-hour window
- Groq API: Check your plan limits
- Implement rate limiting if needed
- Use HTTPS proxies only
- Verify proxy server security
- Monitor proxy logs
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Moscownpur: The magical realm that inspired Xvitz
- Groq: For providing the powerful Llama-3.3-70b model
- Twitter API: For enabling social media automation
- Express.js: For the robust web server framework
For support and questions:
- Create an issue in the repository
- Visit www.moscownpur.in
- Check the troubleshooting section above
Made with ❤️ and AI Magic by the Moscownpur Team
Transform your social media presence with the power of AI and imagination! ✨🚀