Automate answering questions on Quora using AI-generated responses and browser automation!
This project leverages Puppeteer for browser automation, MySQL for credential management, and Google's Generative AI (Gemini) to automatically log into Quora, search for a keyword, and post high-quality AI-generated answers. It demonstrates a pipeline that combines database-driven login, keyword search, question scraping, and AI-powered answering.
Features:
- Login to Quora using credentials stored in MySQL.
- Search for a configurable keyword (e.g., "NextJS").
- Scrape the first question and generate a concise answer using Google's Gemini AI.
- Automatically post the answer using browser automation.
- Modular database credential management with CRUD support.
- Node.js (v16+ recommended)
- npm
- MySQL installed and running (local instance)
- Google Generative AI API Key (Get one here)
- Quora account credentials
-
Clone the repository:
git clone https://github.com/AyushAwasthi2384/qoura-Automation-With-AI.git cd qoura-Automation-With-AI -
Install dependencies:
npm install
-
Configure Environment:
- Copy
.env.exampleto.env(or create.env):GOOGLE_API_KEY=your_google_generative_ai_api_key DB_USER=your_mysql_user DB_PASSWORD=your_mysql_password DB_NAME=autoquora - Ensure your MySQL instance has a database named
autoquora:CREATE DATABASE autoquora;
- Create a
credentialstable:CREATE TABLE credentials ( id INT AUTO_INCREMENT PRIMARY KEY, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL );
- Copy
-
Add your Quora credentials: You can use the included functions (
createCredential) indb.jsto insert credentials, or manually:INSERT INTO credentials (email, password) VALUES ('your_email', 'your_password');
- Start MySQL server (ensure the database is available).
- Run the automation script:
node app.js
- The script launches a browser, logs into Quora, searches for "NextJS", generates an answer, and posts it.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Clone your fork
- Create a new branch
git checkout -b your-feature-branch
- Make your changes
- Test thoroughly
- Commit and push
git commit -m "Describe your change" git push origin your-feature-branch - Open a Pull Request on GitHub
- Follow existing code style.
- Document new functions or features.
- Ensure any credentials or secrets are not hardcoded in code (use
.env). - Test your changes before submitting a PR.
app.js— Main automation script (Puppeteer, MySQL, AI integration)db.js— Database CRUD for credentialsai.js— Google Gemini AI wrapper for generating answers
- Never commit real credentials or API keys.
- Use
.envfor sensitive information. - Consider encrypting credentials in the database for production use.
Maintainer: Ayush Awasthi