Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Chrome Profile AI Agent Automation

This project connects Playwright to an existing Google Chrome Profile 1 session through the Chrome DevTools Protocol. It opens ChatGPT, Gemini, and Claude tabs, sends AI/ML/programming prompts, monitors the EarnPT verified-view counter, and rotates through configured EarnPT accounts.

Requirements

  • Windows 10 or later
  • Node.js 18 or later
  • Google Chrome installed at the default path
  • A Chrome profile named Profile 1
  • The required websites already authenticated in that Chrome profile
  • Permission to use the configured accounts and services

Installation

From PowerShell:

cd F:\Automation
npm install

The project uses Playwright from package.json; no global Playwright installation is required.

Machine-specific environment

Create the local environment file from the template:

Copy-Item .env.copy .env

Set CHROME_USER_HOME in .env to the Windows user home, such as C:/Users/your-windows-username. Set DAILY_VERIFIED_VIEWS_CAP=750 to control the per-account daily limit. The launcher derives the Chrome user-data directory from CHROME_USER_HOME. Profile 1 is created automatically by Chrome on the first launcher run; sign in to the required services in that profile before starting the automation.

Account configuration

Create the local account file from the template:

Copy-Item accounts.json.copy accounts.json

Edit accounts.json and put the authorized account emails in the accounts array. accounts.json is ignored by Git. Do not add passwords, bearer tokens, cookies, or other credentials to this file.

The checked-in accounts.json.copy is only a configuration template. Keep the real local account file uncommitted.

Start Chrome with remote debugging

Run:

.\start-real-chrome-profile1-debug.ps1

The launcher closes existing Chrome processes and starts Chrome with:

  • Profile Profile 1
  • Remote debugging on 127.0.0.1:9222
  • The real Chrome user-data directory

Save any important Chrome work before running the launcher.

Run the automation

node playwright-automation.js

The script validates accounts.json, connects to Chrome, logs into the next eligible account, and captures browser-session cookies in memory. It does not write authentication cookies or bearer tokens to the account file or prompt log.

Account and quota behavior

  • The per-account daily verified-view cap is configured in DAILY_VERIFIED_VIEWS_CAP.
  • The default cap is 750 verified views per account per local calendar day and can be changed with DAILY_VERIFIED_VIEWS_CAP in .env.
  • A new account cycle is started only when the next 95-view cycle fits within the remaining daily quota.
  • Accounts at or beyond the cap are skipped until the next day.
  • A one-hour cooldown is enforced between logins for the same account.
  • If no account is eligible, the ChatGPT, Gemini, and Claude tabs are closed and the process waits.
  • Account selection rotates from the last successful account and skips capped or cooling-down accounts.

Runtime files

These files are intentionally ignored by Git:

  • earnpt_account_state.json — last successful account and login timestamps
  • daily_verified_views.json — per-account daily verified-view baselines, changes, and cumulative totals
  • earnings_millicents.json — latest earnings value per account
  • verified_views_history.log — verified-view and earnings fetch history
  • prompt_history.log — submitted prompt audit log

They are created or updated while the program runs. Delete a runtime ledger only when you intentionally want to reset its local state.

Troubleshooting

Chrome debugging connection fails

Confirm that Chrome was started with the launcher and that port 9222 is available:

Test-NetConnection 127.0.0.1 -Port 9222

Login selection fails

Make sure the configured Google accounts are already available in the Chrome account chooser and that the selected account can access EarnPT. The script verifies the resulting EarnPT session identity after login.

Search results are unavailable

Public search is optional. If the search proxy times out, the script logs a throttled warning and uses built-in AI/ML/programming topics.

Resetting local state

Stop the Node process before changing runtime files. To reset account rotation and quota state, remove earnpt_account_state.json and daily_verified_views.json, then start the program again.

Validation

Before running:

node --check playwright-automation.js

This checks JavaScript syntax without launching Chrome or sending requests.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages