TwitterAgent is a Node.js application that automates interactions with Instagram and Twitter using Playwright and Google Generative AI. It can log in to Instagram, like posts, comment on posts, and generate replies using the Gemini AI model.
- Node.js (v14 or higher)
- npm (v6 or higher)
- Clone the repository:
git clone https://github.com/david-patrick-chuks/Instagram-Agent.git
cd Instagram-AgentAgent.js: Main script that handles Instagram login, post interactions, and comment generation.twitter.js: Script for generating image descriptions and tweet replies using Gemini AI.cookies.json: Stores cookies for Instagram login sessions..env: Environment variables for Instagram credentials and Gemini API keys..env.example: Example environment variables file.package.json: Project metadata and dependencies..gitignore: Specifies files and directories to be ignored by Git.settings.json: VS Code workspace settings.
Logs in to Instagram using the provided credentials and saves cookies for future sessions.
Interacts with Instagram posts by liking and commenting on them. Comments are generated using the Gemini AI model.
Generates a thoughtful and engaging reply to a given Instagram post caption using the Gemini AI model.
Checks if the cookies file exists and if the cookies are still valid.
Highlights elements on the Instagram page for debugging purposes.