Twitter AI Agent is a cutting-edge Next.js application designed to automate and enhance your Twitter interactions using the power of AI. By seamlessly integrating the Twitter API with Google Generative AI, this app enables powerful automation for tweeting, replying, sentiment analysis, trend monitoring, and more. With cron jobs ensuring regular execution, the app ensures you stay connected and engaged with your audience 24/7. 🌟
- 🐦 Automated Tweet Posting: Generate and post creative tweets enriched with emojis for engagement.
- 💬 Smart Mention Handling: Analyze and reply to mentions with sentiment-aware responses.
- 🔥 Trend Monitoring: Stay relevant by posting about trending topics in AI, Blockchain, and Crypto.
- 📊 Follower Analysis: Track follower growth and engagement to refine your content strategy.
- 🗳️ Poll Posting: Post interactive polls to gather opinions from your audience.
- 🔍 Tweet Searching: Search tweets by keywords, like them, and reply based on sentiment analysis.
- ❤️ Auto Like & Reply: Engage with the Twitter community by liking and replying to relevant tweets.
Twitter AI Agent is perfect for individuals or organizations looking to:
- Automate their Twitter activity with minimal manual effort.
- Maintain high engagement and relevance in their niche.
- Leverage AI to create impactful and timely Twitter interactions.
Whether you're a social media manager, influencer, or a tech-savvy professional, this tool is your ultimate assistant for optimizing Twitter strategies. 🚀
- 🔐 Environment Setup: Manage sensitive API keys and tokens securely with
.env.local
. - ⏱️ Scheduled Tasks: Automate tweets, replies, and trend monitoring using cron jobs.
- 🤖 AI Integration: Generate tweets and analyze sentiment with Google Generative AI.
- 🐦 Twitter API: Post tweets, fetch mentions, and monitor trends directly through the Twitter API.
- ✅ Node.js (v14.x or later)
- ✅ npm (v6.x or later) or yarn (v1.x or later)
- ✅ Twitter Developer Account with API keys and tokens
-
Clone the Repository:
git clone https://github.com/g0drlc/Eliza-Twitter-AI-Agent.git cd Eliza-Twitter-AI-Agent
-
Install Dependencies:
Using npm:npm install
Using yarn:
yarn install
-
Set Up Environment Variables:
Create a.env.local
file in the root directory and add:NEXT_PUBLIC_GOOGLE_API_KEY=your-google-api-key NEXT_PUBLIC_TWITTER_API_KEY=your-twitter-api-key NEXT_PUBLIC_TWITTER_API_SECRET=your-twitter-api-secret NEXT_PUBLIC_TWITTER_ACCESS_TOKEN=your-twitter-access-token NEXT_PUBLIC_TWITTER_ACCESS_TOKEN_SECRET=your-twitter-access-token-secret
Replace placeholders with your actual keys and tokens.
-
Run the Development Server:
Using npm:npm run dev
Using yarn:
yarn dev
The app will be accessible at
http://localhost:3000
.
twitter-ai-agent/
├── public/ # Static assets
├── src/ # Source files
│ ├── app/ # Next.js app directory
│ ├── components/ # Reusable React components
│ ├── lib/ # Utility functions and libraries
│ └── ... # Other source files
├── .env.local # Environment variables
├── package.json # Project dependencies
└── README.md # Project documentation
- Twitter API: Post tweets, fetch mentions, and monitor trends effortlessly.
- Google Generative AI: Generate engaging content and perform sentiment analysis.
- Store all API keys and tokens in the
.env.local
file and add it to.gitignore
. - Monitor API usage to avoid exceeding Twitter’s rate limits.
- 🧪 Testing: Conduct local testing to ensure smooth operation.
- 🚀 Deployment: Use platforms like Vercel or Fleek for hosting.
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -m "Add feature"
). - Push to your branch (
git push origin feature-branch
). - Submit a pull request for review.
For questions or feedback, feel free to reach out on Telegram: @g0drlc.