[cron:ac836bad-bf7b-40ae-8ac1-43d80be065c5 X Engagement - Helpful Replies (5/day)] SCHEDULED TASK: Post 1 helpful engagement reply on X/Twitter.

## CRITICAL: Use GHC profile ONLY
- SOCIAL_PROFILE=/home/crogers2287/.social-poster-profile-ghc
- NEVER use /home/crogers2287/.social-poster-profile/ (that's @cannadealsfl)
- NEVER use Maya VM twikit or cannadeals cookies

## CRITICAL: Only Recent Tweets (Last 2 Days)
When searching, ONLY consider tweets from the LAST 2 DAYS.
- Check the tweet timestamp before replying
- If the tweet is older than 48 hours, SKIP IT
- Look for "X hours ago" or "Yesterday" indicators
- NEVER reply to tweets from weeks/months/years ago

## Rules
- Search hashtags: #dealhunter #couponing #savemoney #amazondeal #frugalliving #budgettips #deals #bargain
- Find a REAL person's tweet (not a bot/spam account) that's RECENT (last 48 hours)
- Reply with something genuinely helpful
- NO self-promotion. No links to GottaHaveCoups. Just be helpful.
- NO hashtags on replies
- Log in memory/YYYY-MM-DD.md

## Method
cd /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster
SOCIAL_PROFILE=/home/crogers2287/.social-poster-profile-ghc xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node post.mjs twitter-reply "<reply>" --url "<tweet_url>"
Current time: Saturday, February 14th, 2026 — 4:27 AM (UTC)

Return your summary as plain text; it will be delivered automatically. If the task explicitly calls for messaging a specific external recipient, note who/where it should go instead of sending it yourself.


The user wants me to post a helpful engagement reply on X/Twitter. Let me break down what I need to do:

1. Use the GHC social profile ONLY (not CannaDeals)
2. Search for recent tweets (last 2 days) with hashtags like #dealhunter #couponing #savemoney #amazondeal #frugalliving #budgettips #deals #bargain
3. Find a real person's tweet (not bot/spam)
4. Reply with something genuinely helpful
5. NO self-promotion, NO links to GottaHaveCoups
6. NO hashtags on replies
7. Log in memory/YYYY-MM-DD.md

The command structure:
```
cd /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster
SOCIAL_PROFILE=/home/crogers2287/.social-poster-profile-ghc xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node post.mjs twitter-reply "<reply>" --url "<tweet_url>"
```

First, I need to search for tweets. But the social-poster skill might not have a search function directly. Let me check what I can do.

Actually, looking at the command, it seems like I need to:
1. First, find a tweet to reply to (search manually or use browser)
2. Then use the post.mjs script with twitter-reply action

Since I don't have direct X API access, I might need to use browser automation or find another way. Let me check if there's a way to search.

Wait - the user is asking me to do this task. I should probably use the browser to search for relevant tweets, find one from the last 2 days, and then reply.

Let me start by checking if I can access X/Twitter through the browser or if there's another method.

I'll handle this X engagement task. Let me first search for recent tweets with relevant hashtags to find a real person to engage with.


Can't reach the OpenClaw browser control service. Start (or restart) the OpenClaw gateway (OpenClaw.app menubar, or `openclaw gateway`) and try again. (Error: Error: Chrome extension relay is running, but no tab is connected. Click the OpenClaw Chrome extension icon on a tab to attach it (profile "chrome").)


The browser isn't connected. Let me try a different approach - I can use the social-poster skill directly if it has a search capability, or I might need to use twikit directly via SSH to the Maya VM.

Actually, looking at the task more carefully, I should probably use the node skill with the social-poster. But first, let me check what the social-poster skill can do.


ENOENT: no such file or directory, access '/home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster/SKILL.md'


The file doesn't exist there. Let me look for the social-poster skill in a different location.

exec

find /home/crogers2287 -name "social-poster" -type d 2>/dev/null | head -5


Command still running (session wild-comet, pid 3269353). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


The command is taking too long. Let me try a more targeted search or just use the path provided in the task instructions.


Killed session wild-comet.


Let me try to find the social-poster skill more directly.

ls -la /home/crogers2287/openclaw-workspaces/ 2>/dev/null || ls -la ~/.openclaw/skills/ 2>/dev/null | head -20


total 64
drwxr-xr-x   7 crogers2287 crogers2287  4096 Feb 11 17:20 .
drwxr-xr-x 302 crogers2287 crogers2287 28672 Feb 13 15:03 ..
drwxr-xr-x   4 crogers2287 crogers2287  4096 Feb 11 17:19 ash-permits
drwxr-xr-x  16 crogers2287 crogers2287  4096 Feb 13 20:45 cannadeals-marketing
drwxr-xr-x   3 crogers2287 crogers2287  4096 Feb 11 17:15 clinker
drwxr-xr-x  11 crogers2287 crogers2287  4096 Feb 13 15:00 ghc-marketing
drwxr-xr-x  13 crogers2287 crogers2287 12288 Feb 12 03:59 mark-twain


The ghc-marketing workspace exists. Let me check if there's a social-poster skill there.

find /home/crogers2287/openclaw-workspaces/ghc-marketing -name "*.mjs" -o -name "post.*" 2>/dev/null | head -10


(no output)


Let me try to search for the social-poster in the cannadeals-marketing workspace since that was mentioned in the path.

ls -la /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/ 2>/dev/null


total 20
drwx---rwx  5 crogers2287 crogers2287 4096 Feb 12 13:41 .
drwxr-xr-x 16 crogers2287 crogers2287 4096 Feb 13 20:45 ..
drwxrwxr-x  4 crogers2287 crogers2287 4096 Feb 12 13:41 cdc-social-poster
drwx---rwx  2 crogers2287 crogers2287 4096 Feb 11 17:20 marketing-playbook
drwxrwxr-x  3 crogers2287 crogers2287 4096 Feb 14 03:28 social-poster


Found it! The social-poster is at `/home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster`. Let me check its SKILL.md and understand how to use it.


No SKILL.md. Let me check what's in the directory.


total 128
drwxrwxr-x  3 crogers2287 crogers2287  4096 Feb 14 03:28 .
drwx---rwx  5 crogers2287 crogers2287  4096 Feb 12 13:41 ..
-rw-rw-r--  1 crogers2287 crogers2287  1406 Feb 12 02:30 _inject_ghc.mjs
-rw-rw-r--  1 crogers2287 crogers2287  1917 Feb 13 20:50 check_login.mjs
-rw-rw-r--  1 crogers2287 crogers2287  3348 Feb 13 20:49 debug_search.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2808 Feb 12 13:06 delete_by_content.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2944 Feb 12 12:44 delete_tweet.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2093 Feb 13 20:51 find_tweets.mjs
-rwxrwxr-x  1 crogers2287 crogers2287  2153 Feb 14 00:01 find_tweets_fast.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2242 Feb 12 02:15 inject_ghc_cookies.mjs
-rw-rw-r--  1 crogers2287 crogers2287  1523 Feb 12 02:15 inject_ghc_pinterest.mjs
-rw-rw-r--  1 crogers2287 crogers2287  3095 Feb 14 01:16 maya_search.mjs
drwxrwxr-x 46 crogers2287 crogers2287  4096 Feb 12 01:19 node_modules
-rw-rw-r--  1 crogers2287 crogers2287 21575 Feb 12 01:19 package-lock.json
-rw-rw-r--  1 crogers2287 crogers2287   400 Feb 12 01:19 package.json
-rw-rw-r--  1 crogers2287 crogers2287  9820 Feb 13 15:03 post.mjs
-rwxrwxr-x  1 crogers2287 crogers2287  2653 Feb 14 00:02 post_fast.mjs
-rw-rw-r--  1 crogers2287 crogers2287  9825 Feb 14 03:28 post_fixed.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2935 Feb 12 01:33 reddit-login.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2899 Feb 14 03:26 search_authentic.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2507 Feb 14 03:27 search_authentic_v2.mjs
-rw-rw-r--  1 crogers2287 crogers2287  2493 Feb 14 03:27 search_authentic_v3.mjs
-rw-rw-r--  1 crogers2287 crogers2287  3420 Feb 13 20:49 search_tweets.mjs


I see there are several search scripts. Let me check:
- `find_tweets.mjs` - probably for finding tweets
- `search_authentic_v3.mjs` - maybe for authentic searches
- `maya_search.mjs` - might be useful

Let me also check the post.mjs to understand how to post a reply.


#!/usr/bin/env node
import { chromium } from 'playwright-extra';
import stealthPlugin from 'puppeteer-extra-plugin-stealth';
import { execSync } from 'child_process';
import fs from 'fs';

chromium.use(stealthPlugin());

const PROFILE_DIR = '/home/crogers2287/.social-poster-profile-ghc';
const XVFB_DISPLAY = ':99';

function ensureXvfb() {
  try {
    execSync(`pgrep -f "Xvfb ${XVFB_DISPLAY}"`, { stdio: 'ignore' });
  } catch {
    execSync(`Xvfb ${XVFB_DISPLAY} -screen 0 1920x1080x24 &`, { stdio: 'ignore' });
    execSync('sleep 1');
  }
  process.env.DISPLAY = XVFB_DISPLAY;
}

async function search() {
  ensureXvfb();
  const browser = await chromium.launchPersistentContext(PROFILE_DIR, {
    headless: false,
    viewport: { width: 1920, height: 1080 },
    args: ['--no-sandbox', '--disable-blink-features=AutomationControlled', `--display=${XVFB_DISPLAY}`],
    ignoreDefaultArgs: ['--enable-automation'],
  });

  const page = browser.pages()[0] || await browser.newPage();

  try {
    const query = '#savemoney OR #budgettips OR #frugalliving';
    await page.goto(`https://x.com/search?q=${encodeURIComponent(query)}&src=typed_query&f=live`, { waitUntil: 'networkidle', timeout: 60000 });
    await page.waitForTimeout(5000);

    const tweets = await page.$$eval('article[data-testid="tweet"]', articles => {
      return articles.map(article => {
        const textEl = article.querySelector('[data-testid="tweetText"]');
        const timeEl = article.querySelector('time');
        const linkEl = article.querySelector('a[href*="/status/"]');
        const userEl = article.querySelector('[data-testid="User-Name"]');

        return {
          text: textEl ? textEl.innerText : '',
          time: timeEl ? timeEl.getAttribute('datetime') : '',
          url: linkEl ? 'https://x.com' + linkEl.getAttribute('href') : '',
          user: userEl ? userEl.innerText.split('\n')[0] : 'unknown'
        };
      });
    });

    console.log(JSON.stringify(tweets, null, 2));
  } finally {
    await browser.close();
  }
}

search().catch(console.error);


This is perfect! This script will search for tweets. Let me run it to find recent tweets to reply to.

Let me search for recent tweets with relevant hashtags to find someone to engage with.

cd /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster && node find_tweets.mjs


Command still running (session gentle-crustacean, pid 3274630). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


The command is still running. Let me wait a bit and check the output.


(no new output)

Process still running.


Let me wait a bit longer for it to finish.


Command still running (session warm-meadow, pid 3277945). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


The sleep command is also running. Let me check the first command again.


(no output yet)


Let me wait more or try a different approach. Maybe I should check if there's a faster search script.


#!/usr/bin/env node
import { chromium } from 'playwright-extra';
import stealthPlugin from 'puppeteer-extra-plugin-stealth';
import { execSync } from 'child_process';
import fs from 'fs';

chromium.use(stealthPlugin());

const PROFILE_DIR = '/home/crogers2287/.social-poster-profile-ghc';
const XVFB_DISPLAY = ':99';

function ensureXvfb() {
  try {
    execSync(`pgrep -f "Xvfb ${XVFB_DISPLAY}"`, { stdio: 'ignore' });
  } catch {
    execSync(`Xvfb ${XVFB_DISPLAY} -screen 0 1920x1080x24 &`, { stdio: 'ignore' });
    execSync('sleep 1');
  }
  process.env.DISPLAY = XVFB_DISPLAY;
}

async function search() {
  ensureXvfb();
  const browser = await chromium.launchPersistentContext(PROFILE_DIR, {
    headless: false,
    viewport: { width: 1920, height: 1080 },
    args: ['--no-sandbox', '--disable-blink-features=AutomationControlled', `--display=${XVFB_DISPLAY}`],
    ignoreDefaultArgs: ['--enable-automation'],
  });

  const page = browser.pages()[0] || await browser.newPage();

  try {
    const query = '#savemoney OR #budgettips OR #frugalliving OR #couponing OR #deals';
    await page.goto(`https://x.com/search?q=${encodeURIComponent(query)}&src=typed_query&f=live`, { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(10000); // Wait for results to render

    const tweets = await page.$$eval('article[data-testid="tweet"]', articles => {
      return articles.map(article => {
        const textEl = article.querySelector('[data-testid="tweetText"]');
        const timeEl = article.querySelector('time');
        const linkEl = article.querySelector('a[href*="/status/"]');
        const userEl = article.querySelector('[data-testid="User-Name"]');

        return {
          text: textEl ? textEl.innerText : '',
          time: timeEl ? timeEl.getAttribute('datetime') : '',
          url: linkEl ? 'https://x.com' + linkEl.getAttribute('href') : '',
          user: userEl ? userEl.innerText.split('\n')[0] : 'unknown'
        };
      });
    });

    console.log(JSON.stringify(tweets, null, 2));
  } finally {
    await browser.close();
  }
}

search().catch(console.error);


Let me kill the slow process and try the fast one.


Killed session gentle-crustacean.


No active session found for warm-meadow


cd /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster && node find_tweets_fast.mjs


Command still running (session fresh-orbit, pid 3282556). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


Still running. Let me wait a bit and then check the output.


Command still running (session lucky-mist, pid 3284626). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


Let me check the output of the find_tweets_fast command.


This Valentine’s, we’re dating at Fashion Factory.

Because couples who save together, stay together.

Visit the store and celebrate Valentine's Day in style.

Fashion 365 Days | 20-70% Discounts | Best Brands

#FashionFactory #BestBrands #Deals #Valentine

Stanley Water Bottle OVER 50% OFF!

https://
amzn.to/4rSzqJv #ad #deals

Brake pads STEAL!  RUN

https://
amzn.to/3OhHaGv #ad #deals

Perfume and Cologne Refill Hack!  #savemoney #budgeting #moneytips
https://
youtube.com/shorts/ohPGqGS
PZ-Y?si=udvXEgFkWK8KkSnW
… via
@YouTube

$180 Bedspread Set now only $37.99!

https://
mavely.app.link/nI6YkKm0J0b #ad #Deals

RYOBI 18V 4-Tool Combo Kit w/ 1.5Ah/4.0Ah Battery & Diamond Grit Driving Set $139  *ad
https://
slickdeals.net/f/19205740-ryo
bi-one-18v-cordless-4-tool-combo-kit-with-1-5-ah-battery-4-0-ah-battery-charger-and-diamond-grit-driving-set-138-97-free-shipping?utm_source=rss&utm_content=fp&utm_medium=RSS2&utm_source=twitter
…
#deals

TEMU Dog Multivitamin Chewable With & Msm, 3 & 6, Probiotics, Dog Vitamins And Supplements For Overall Health 120  #deals #offers #todayDeals #ad #coupons #dailydeals

Adidas Samba Unisex Shoes - $66.99 $67 *ad
https://
slickdeals.net/f/19201732-adi
das-samba-unisex-shoes-66-99-67?utm_source=rss&utm_content=def&utm_medium=RSS2&utm_source=twitter&utm_medium=organic_social&utm_content=rss
…
#deals

https://
posh.mk/EiedTJ3XJ0b
#Poshmark #Deals #Clothes #Vintage #Modern #Cashmere #Wool #Sweaters #Nike #NCAA #Opentooffers


I found several tweets. Looking at the timestamps, they're all from today (2026-02-14). Let me pick one that looks like a real person (not a bot/spam account):

1. **Joe Keil** - "Perfume and Cologne Refill Hack! #savemoney #budgeting #moneytips" - This looks like a real person sharing a tip about saving money on perfume/cologne refills. The tweet is from about 1 hour ago (03:26:57 UTC vs current 04:27 UTC). This is a good candidate for engagement.

Let me reply to Joe Keil's tweet about the perfume refill hack with something helpful.

The tweet URL is: https://x.com/joachim_ke32999/status/2022512863492084162

Now I need to craft a helpful reply (no self-promotion, no hashtags, just helpful):

"That's a great tip! Refillable atomizers are also amazing for travel - you can take your favorite scent without the bulk of the full bottle. Saves space AND money."

Now let me post the reply using the post.mjs script.

I found some recent tweets. Let me pick one from a real person - Joe Keil sharing a perfume refill hack. This is perfect for genuine engagement.


#!/usr/bin/env node
/**
 * CannaDeals Social Poster - Stealth Browser Automation
 * Uses Playwright + Stealth Plugin + Persistent Profile
 *
 * Usage:
 *   node post.mjs twitter "Tweet text here" [--image /path/to/img.jpg]
 *   node post.mjs pinterest "Pin description" --title "Pin Title" --link "https://..." [--image /path/to/img.jpg] [--board "Florida Cannabis Deals"]
 *   node post.mjs reddit-comment "Comment text" --url "https://reddit.com/r/.../comments/..."
 *
 * First run: use --login to open browser for manual auth
 *   node post.mjs twitter --login
 */

import { chromium } from 'playwright-extra';
import stealthPlugin from 'puppeteer-extra-plugin-stealth';
import { execSync } from 'child_process';
import path from 'path';
import fs from 'fs';

// Stealth
chromium.use(stealthPlugin());

// Config
const PROFILE_DIR = process.env.SOCIAL_PROFILE || '/home/crogers2287/.social-poster-profile';
const XVFB_DISPLAY = ':99';

// Human-like typing with occasional pauses
async function humanType(locator, text, opts = {}) {
  const baseDelay = opts.delay || 80;
  for (let i = 0; i < text.length; i++) {
    await locator.pressSequentially(text[i], { delay: baseDelay + Math.random() * 60 });
    // Occasional longer pause (thinking)
    if (Math.random() < 0.05) {
      await locator.page().waitForTimeout(300 + Math.random() * 500);
    }
  }
}

// Ensure Xvfb is running
function ensureXvfb() {
  try {
    execSync(`pgrep -f "Xvfb ${XVFB_DISPLAY}"`, { stdio: 'ignore' });
  } catch {
    console.log('[*] Starting Xvfb...');
    execSync(`Xvfb ${XVFB_DISPLAY} -screen 0 1920x1080x24 &`, { stdio: 'ignore' });
    execSync('sleep 1');
  }
  process.env.DISPLAY = XVFB_DISPLAY;
}

async function launchBrowser(headless = false) {
  ensureXvfb();

  const browser = await chromium.launchPersistentContext(PROFILE_DIR, {
    headless: false, // Must be false for stealth — Xvfb provides the display
    channel: undefined, // Use Playwright's bundled Chromium
    viewport: { width: 1920, height: 1080 },
    args: [
      '--no-sandbox',
      '--disable-blink-features=AutomationControlled',
      '--disable-features=IsolateOrigins,site-per-process',
      `--display=${XVFB_DISPLAY}`,
    ],
    ignoreDefaultArgs: ['--enable-automation'],
  });

  return browser;
}

// ==================== TWITTER ====================
async function postTwitter(text, imagePath) {
  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();

  try {
    await page.goto('https://x.com/compose/post', { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(2000);

    // Check login
    const url = page.url();
    if (url.includes('/login') || url.includes('/i/flow/login')) {
      throw new Error('Not logged in! Run with --login first.');
    }

    // Upload image first if provided
    if (imagePath && fs.existsSync(imagePath)) {
      console.log(`[*] Uploading image: ${imagePath}`);
      const fileInput = page.locator('input[type="file"][data-testid="fileInput"]').first();
      await fileInput.setInputFiles(imagePath);
      await page.waitForTimeout(3000);
    }

    // Type tweet — use the primary column one to avoid strict mode violation
    const textBox = page.locator('[data-testid="tweetTextarea_0"]').first();
    await textBox.click();
    await page.waitForTimeout(500);
    await humanType(textBox, text);

    await page.waitForTimeout(1500);

    // Post
    const postBtn = page.locator('[data-testid="tweetButton"]');
    await postBtn.click();

    await page.waitForTimeout(5000);
    console.log('[+] Tweet posted successfully!');

  } finally {
    await page.waitForTimeout(3000);
    await browser.close();
  }
}

// ==================== TWITTER REPLY ====================
async function replyTwitter(text, tweetUrl) {
  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();

  try {
    await page.goto(tweetUrl, { waitUntil: 'networkidle', timeout: 30000 });
    await page.waitForTimeout(2000);

    // Click reply box
    const replyBox = page.locator('[data-testid="tweetTextarea_0"]');
    await replyBox.click();
    await page.waitForTimeout(500);
    await humanType(replyBox, text);

    await page.waitForTimeout(1500);

    const replyBtn = page.locator('[data-testid="tweetButtonInline"]');
    await replyBtn.click();

    await page.waitForTimeout(5000);
    console.log('[+] Reply posted successfully!');

  } finally {
    await page.waitForTimeout(3000);
    await browser.close();
  }
}

// ==================== PINTEREST ====================
async function postPinterest(description, title, link, imagePath, boardName) {
  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();

  try {
    await page.goto('https://www.pinterest.com/pin-builder/', { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(2000);

    if (page.url().includes('/login')) {
      throw new Error('Not logged in to Pinterest! Run with --login first.');
    }

    // Upload image
    if (imagePath && fs.existsSync(imagePath)) {
      const fileInput = page.locator('input[type="file"]').first();
      await fileInput.setInputFiles(imagePath);
      await page.waitForTimeout(3000);
    }

    // Title
    if (title) {
      const titleInput = page.locator('[placeholder="Add your title"]');
      await titleInput.click();
      await humanType(titleInput, title);
    }

    // Description
    const descInput = page.locator('[placeholder*="Pin is about"], [placeholder*="what your Pin"], [data-testid="pin-draft-description"] div[contenteditable], .descriptionArea [contenteditable]').first();
    await descInput.click();
    await humanType(descInput, description, { delay: 50 });

    // Link
    if (link) {
      const linkInput = page.locator('[placeholder="Add a destination link"]');
      await linkInput.click();
      await linkInput.fill(link);
    }

    // Board selection
    if (boardName) {
      await page.waitForTimeout(1000);
      const boardBtn = page.locator('[data-testid="board-dropdown-select-button"]').first();
      if (await boardBtn.isVisible()) {
        await boardBtn.click();
        await page.waitForTimeout(1000);
        await page.getByText(boardName).first().click();
        await page.waitForTimeout(1000);
      }
    }

    await page.waitForTimeout(2000);

    // Publish
    const saveBtn = page.getByRole('button', { name: /Publish|Save/ }).first();
    await saveBtn.click();

    await page.waitForTimeout(5000);
    console.log('[+] Pin published successfully!');

  } finally {
    await page.waitForTimeout(3000);
    await browser.close();
  }
}

// ==================== REDDIT COMMENT ====================
async function commentReddit(text, postUrl) {
  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();

  try {
    // Navigate to post
    await page.goto(postUrl, { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(3000);

    if (page.url().includes('/login')) {
      throw new Error('Not logged in to Reddit! Run with --login first.');
    }

    // Find and click comment box
    const commentBox = page.locator('[contenteditable="true"]').first();
    await commentBox.click();
    await page.waitForTimeout(500);
    await humanType(commentBox, text, { delay: 60 });

    await page.waitForTimeout(2000);

    // Submit
    await page.getByRole('button', { name: /Comment|Submit/ }).first().click();

    await page.waitForTimeout(5000);
    console.log('[+] Reddit comment posted!');

  } finally {
    await page.waitForTimeout(3000);
    await browser.close();
  }
}

// ==================== LOGIN MODE ====================
async function loginMode(platform) {
  ensureXvfb();
  console.log(`[*] Opening browser for manual ${platform} login...`);
  console.log('[*] The browser is running on Xvfb (virtual display).');
  console.log('[*] To interact, use VNC or the Chrome relay.');
  console.log('[*] Press Ctrl+C when done logging in.');

  const urls = {
    twitter: 'https://x.com/login',
    pinterest: 'https://www.pinterest.com/login/',
    reddit: 'https://www.reddit.com/login/',
  };

  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();
  await page.goto(urls[platform] || urls.twitter);

  // Keep alive until killed
  await new Promise(() => {});
}

// ==================== CLI ====================
const args = process.argv.slice(2);
const platform = args[0];
const text = args[1];

const getFlag = (name) => {
  const idx = args.indexOf(`--${name}`);
  return idx !== -1 ? args[idx + 1] : null;
};

const hasFlag = (name) => args.includes(`--${name}`);

if (hasFlag('login')) {
  loginMode(platform);
} else if (platform === 'twitter') {
  postTwitter(text, getFlag('image'));
} else if (platform === 'twitter-reply') {
  replyTwitter(text, getFlag('url'));
} else if (platform === 'pinterest') {
  postPinterest(text, getFlag('title'), getFlag('link'), getFlag('image'), getFlag('board') || 'Florida Cannabis Deals');
} else if (platform === 'reddit-comment') {
  commentReddit(text, getFlag('url'));
} else {
  console.log('Usage:');
  console.log('  node post.mjs twitter "Tweet text"');
  console.log('  node post.mjs twitter-reply "Reply text" --url https://x.com/...');
  console.log('  node post.mjs pinterest "Description" --title "Title" --link "https://..." --image /path/to/img');
  console.log('  node post.mjs reddit-comment "Comment" --url https://reddit.com/...');
  console.log('  node post.mjs <platform> --login');
}


I see the script supports `twitter-reply` with the `--url` flag. Let me use this to reply to Joe Keil's tweet. I'll craft a helpful reply about perfume refills.

Now I'll post a helpful reply to Joe Keil's tweet about the perfume refill hack.

cd /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster && SOCIAL_PROFILE=/home/crogers2287/.social-poster-profile-ghc xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node post.mjs twitter-reply "That's a great tip! Refillable atomizers are also amazing for travel - you can take your favorite scent without the bulk of the full bottle. Saves space AND money." --url "https://x.com/joachim_ke32999/status/2022512863492084162"


Command still running (session ember-ocean, pid 3291367). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


The command is running. Let me wait and check for output.


Command still running (session cool-prairie, pid 3293837). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


Let me check the output of the first command.


(no output yet)


(no new output)

Process still running.


Command still running (session calm-sable, pid 3296981). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

page.goto: Timeout 30000ms exceeded.
Call log:
  - navigating to "https://x.com/joachim_ke32999/status/2022512863492084162", waiting until "networkidle"

    at replyTwitter (/home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster/post.mjs:121:16) {
  name: 'TimeoutError'
}

Node.js v22.20.0


The page timed out. Let me try again with a shorter waitUntil setting. Or maybe I should try the fixed version.


#!/usr/bin/env node
/**
 * CannaDeals Social Poster - Stealth Browser Automation
 * Uses Playwright + Stealth Plugin + Persistent Profile
 *
 * Usage:
 *   node post.mjs twitter "Tweet text here" [--image /path/to/img.jpg]
 *   node post.mjs pinterest "Pin description" --title "Pin Title" --link "https://..." [--image /path/to/img.jpg] [--board "Florida Cannabis Deals"]
 *   node post.mjs reddit-comment "Comment text" --url "https://reddit.com/r/.../comments/..."
 *
 * First run: use --login to open browser for manual auth
 *   node post.mjs twitter --login
 */

import { chromium } from 'playwright-extra';
import stealthPlugin from 'puppeteer-extra-plugin-stealth';
import { execSync } from 'child_process';
import path from 'path';
import fs from 'fs';

// Stealth
chromium.use(stealthPlugin());

// Config
const PROFILE_DIR = process.env.SOCIAL_PROFILE || '/home/crogers2287/.social-poster-profile';
const XVFB_DISPLAY = ':99';

// Human-like typing with occasional pauses
async function humanType(locator, text, opts = {}) {
  const baseDelay = opts.delay || 80;
  for (let i = 0; i < text.length; i++) {
    await locator.pressSequentially(text[i], { delay: baseDelay + Math.random() * 60 });
    // Occasional longer pause (thinking)
    if (Math.random() < 0.05) {
      await locator.page().waitForTimeout(300 + Math.random() * 500);
    }
  }
}

// Ensure Xvfb is running
function ensureXvfb() {
  try {
    execSync(`pgrep -f "Xvfb ${XVFB_DISPLAY}"`, { stdio: 'ignore' });
  } catch {
    console.log('[*] Starting Xvfb...');
    execSync(`Xvfb ${XVFB_DISPLAY} -screen 0 1920x1080x24 &`, { stdio: 'ignore' });
    execSync('sleep 1');
  }
  process.env.DISPLAY = XVFB_DISPLAY;
}

async function launchBrowser(headless = false) {
  ensureXvfb();

  const browser = await chromium.launchPersistentContext(PROFILE_DIR, {
    headless: false, // Must be false for stealth — Xvfb provides the display
    channel: undefined, // Use Playwright's bundled Chromium
    viewport: { width: 1920, height: 1080 },
    args: [
      '--no-sandbox',
      '--disable-blink-features=AutomationControlled',
      '--disable-features=IsolateOrigins,site-per-process',
      `--display=${XVFB_DISPLAY}`,
    ],
    ignoreDefaultArgs: ['--enable-automation'],
  });

  return browser;
}

// ==================== TWITTER ====================
async function postTwitter(text, imagePath) {
  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();

  try {
    await page.goto('https://x.com/compose/post', { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(2000);

    // Check login
    const url = page.url();
    if (url.includes('/login') || url.includes('/i/flow/login')) {
      throw new Error('Not logged in! Run with --login first.');
    }

    // Upload image first if provided
    if (imagePath && fs.existsSync(imagePath)) {
      console.log(`[*] Uploading image: ${imagePath}`);
      const fileInput = page.locator('input[type="file"][data-testid="fileInput"]').first();
      await fileInput.setInputFiles(imagePath);
      await page.waitForTimeout(3000);
    }

    // Type tweet — use the primary column one to avoid strict mode violation
    const textBox = page.locator('[data-testid="tweetTextarea_0"]').first();
    await textBox.click();
    await page.waitForTimeout(500);
    await humanType(textBox, text);

    await page.waitForTimeout(1500);

    // Post
    const postBtn = page.locator('[data-testid="tweetButton"]');
    await postBtn.click();

    await page.waitForTimeout(5000);
    console.log('[+] Tweet posted successfully!');

  } finally {
    await page.waitForTimeout(3000);
    await browser.close();
  }
}

// ==================== TWITTER REPLY ====================
async function replyTwitter(text, tweetUrl) {
  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();

  try {
    await page.goto(tweetUrl, { waitUntil: 'domcontentloaded', timeout: 30000 });
    await page.waitForTimeout(2000);

    // Click reply box
    const replyBox = page.locator('[data-testid="tweetTextarea_0"]');
    await replyBox.click();
    await page.waitForTimeout(500);
    await humanType(replyBox, text);

    await page.waitForTimeout(1500);

    const replyBtn = page.locator('[data-testid="tweetButtonInline"]');
    await replyBtn.click();

    await page.waitForTimeout(5000);
    console.log('[+] Reply posted successfully!');

  } finally {
    await page.waitForTimeout(3000);
    await browser.close();
  }
}

// ==================== PINTEREST ====================
async function postPinterest(description, title, link, imagePath, boardName) {
  const browser = await launchBrowser();
  const page = browser.pages()[0] || await browser.newPage();

  try {
    await page.goto('https://www.pinterest.com/pin-builder/', { waitUntil: 'domcontentloaded', timeout: 30000 });

[146 more lines in file. Use offset=151 to continue.]


I see the fixed version uses `domcontentloaded` instead of `networkidle`. Let me try using that version.


No active session found for ember-ocean


[cron:ac836bad-bf7b-40ae-8ac1-43d80be065c5 X Engagement - Helpful Replies (5/day)] SCHEDULED TASK: Post 1 helpful engagement reply on X/Twitter.

## CRITICAL: Use GHC profile ONLY
- SOCIAL_PROFILE=/home/crogers2287/.social-poster-profile-ghc
- NEVER use /home/crogers2287/.social-poster-profile/ (that's @cannadealsfl)
- NEVER use Maya VM twikit or cannadeals cookies

## CRITICAL: Only Recent Tweets (Last 2 Days)
When searching, ONLY consider tweets from the LAST 2 DAYS.
- Check the tweet timestamp before replying
- If the tweet is older than 48 hours, SKIP IT
- Look for "X hours ago" or "Yesterday" indicators
- NEVER reply to tweets from weeks/months/years ago

## Rules
- Search hashtags: #dealhunter #couponing #savemoney #amazondeal #frugalliving #budgettips #deals #bargain
- Find a REAL person's tweet (not a bot/spam account) that's RECENT (last 48 hours)
- Reply with something genuinely helpful
- NO self-promotion. No links to GottaHaveCoups. Just be helpful.
- NO hashtags on replies
- Log in memory/YYYY-MM-DD.md

## Method
cd /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster
SOCIAL_PROFILE=/home/crogers2287/.social-poster-profile-ghc xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node post.mjs twitter-reply "<reply>" --url "<tweet_url>"
Current time: Saturday, February 14th, 2026 — 4:27 AM (UTC)

Return your summary as plain text; it will be delivered automatically. If the task explicitly calls for messaging a specific external recipient, note who/where it should go instead of sending it yourself.


cd /home/crogers2287/openclaw-workspaces/cannadeals-marketing/skills/social-poster && SOCIAL_PROFILE=/home/crogers2287/.social-poster-profile-ghc xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" node post_fixed.mjs twitter-reply "That's a great tip! Refillable atomizers are also amazing for travel - you can take your favorite scent without the bulk of the full bottle. Saves space AND money." --url "https://x.com/joachim_ke32999/status/2022512863492084162"


Command still running (session dawn-lobster, pid 3302337). Use process (list/poll/log/write/kill/clear/remove) for follow-up.


sessionId is required for this action.