[cron:6dd85dd2-28ce-411f-b2de-8106e314da47 Deal Post - X + Pinterest (every 30 min)] SCHEDULED TASK: Post 1 deal to X and Pinterest using Maya VM twikit/py3-pinterest.

## CRITICAL: Use Maya VM, NOT Fred social-poster
- X: twikit v2.3.3 on Maya VM (`ssh maya@maya`)
- Script: `/home/maya/workspace/scripts/x_twikit_post2.py`
- Cookies: `/home/maya/workspace/x_cookies.json`

## Workflow
1. Fetch deals: `curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" | python3 -c "import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get('deals',[]); [print(f\"{x['id']}|{x.get('title','')[:60]}|${x.get('price','')}|{x.get('discount_percentage',0)}%\") for x in deals[:15]]"`
2. Check hash: `python3 scripts/posted_db.py check <deal_id> x`
3. If POSTED:YES — SKIP, pick another
4. Pick unposted deal (50%+ off, popular brand, limited time, freebies, under $10)
5. Download share image: `wget -q "https://www.gottahavecoups.com/api/v1/share/image/<deal_id>" -O /tmp/deal_img.jpg`
6. **BUILD TWEET:** Hook + value + 5-8 hashtags + link LAST. KEEP UNDER 280 CHARS.
7. **MANDATORY VALIDATION:** `python3 scripts/validate_tweet.py '<tweet_text>'` — If INVALID, STOP and pick different deal.
8. **POST TO X (Maya VM twikit):**
   ```bash
   ssh maya@maya "cat > /tmp/tweet.txt << 'TWEET'
   <tweet text here>
   TWEET"
   scp /tmp/deal_img.jpg maya@maya:/tmp/deal_img.jpg
   ssh maya@maya "python3 /home/maya/workspace/scripts/x_twikit_post2.py <deal_id> --file /tmp/tweet.txt"
   ```
9. **POST TO PINTEREST (Maya VM py3-pinterest):**
   ```bash
   ssh maya@maya "python3 /home/maya/workspace/scripts/pin_post_v2.py <deal_id> '<title>' '<description>' 1134485031073239531"
   ```
10. Record posts: `python3 scripts/posted_db.py record <deal_id> x <tweet_id> <url>`
11. Log in memory/YYYY-MM-DD.md

## If X cookies expired
Run: `ssh maya@maya "DISPLAY=:0 python3 /home/maya/workspace/scripts/extract_x_cookies.py"`

## Tweet format (STRICT)
- Hook (emoji + deal highlight)
- Product name + price (with $, e.g., "$12.99")
- 5-8 hashtags
- Link LAST: gottahavecoups.com/deal/<id>
- KEEP UNDER 280 CHARS

## NEVER post if validation fails:
- Shell artifacts (/bin/bash, python3 -c)
- Broken prices (.20 instead of $10.20)
- Broken emojis (�)
- > 280 chars
Current time: Thursday, February 12th, 2026 — 10:57 PM (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 execute a scheduled cron task to post a deal to X and Pinterest. Let me follow the workflow step by step.

First, I need to:
1. Fetch deals from the API
2. Check which ones have been posted
3. Pick an unposted deal
4. Download the image
5. Build a tweet
6. Validate it
7. Post to X and Pinterest using Maya VM

Let me start by fetching the deals.

I'll execute this scheduled deal posting task. Let me start by fetching the latest deals.

exec

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" | python3 -c "import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get('deals',[]); [print(f\"{x['id']}|{x.get('title','')[:60]}|${x.get('price','')}|{x.get('discount_percentage',0)}%\") for x in deals[:15]]"


/bin/bash: line 1: import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get('deals',[]); [print(f"{x['id']}|{x.get('title','')[:60]}|${x.get('price','')}|{x.get('discount_percentage',0)}%") for x in deals[:15]]: bad substitution

Command exited with code 1


The shell is having issues with the command. Let me try a different approach - write the python script to a file and execute it.

Let me fix the command escaping:

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" -o /tmp/deals.json && cat /tmp/deals.json | python3 -c 'import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get("deals",[]); [print(f"{x[chr(39)]id[chr(39)]}|{x.get(chr(39)+chr(39),chr(39)+chr(39))[:60]}|${x.get(chr(39)+chr(39),chr(39)+chr(39))}|{x.get(chr(39)+chr(39),0)}%") for x in deals[:15]]'


File "<string>", line 1
    import sys,json; d=json.load(sys.stdin); deals=d if isinstance(d,list) else d.get("deals",[]); [print(f"{x[chr(39)]id[chr(39)]}|{x.get(chr(39)+chr(39),chr(39)+chr(39))[:60]}|${x.get(chr(39)+chr(39),chr(39)+chr(39))}|{x.get(chr(39)+chr(39),0)}%") for x in deals[:15]]
                                                                                ^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

Command exited with code 1


Let me use a simpler approach - write a Python script to a file and run it.

Let me use a simpler approach with a Python script file:

write

import sys,json
d=json.load(sys.stdin)
deals=d if isinstance(d,list) else d.get('deals',[])
for x in deals[:15]:
    print(f"{x['id']}|{x.get('title','')[:60]}|${x.get('price','')}|{x.get('discount_percentage',0)}%")


Successfully wrote 217 bytes to /tmp/parse_deals.py


Now let me run the curl and pipe it to the Python script.

exec

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" | python3 /tmp/parse_deals.py


Traceback (most recent call last):
  File "/tmp/parse_deals.py", line 2, in <module>
    d=json.load(sys.stdin)
      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Command exited with code 1


The API call seems to be failing. Let me check what the curl returns.

Let me check the API response:

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" -o /tmp/deals_raw.json && head -c 500 /tmp/deals_raw.json


(no output)


The curl seems to be returning nothing or timing out. Let me try with verbose output.

curl -v "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" --connect-timeout 10 2>&1 | head -50


% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Host www.gottahavecoups.com:443 was resolved.
* IPv6: 2606:4700:3037::6815:441e, 2606:4700:3033::ac43:b9d7
* IPv4: 172.67.185.215, 104.21.68.30
*   Trying 172.67.185.215:443...
* Connected to www.gottahavecoups.com (172.67.185.215) port 443
* ALPN: curl offers h2,http/1.1
} [5 bytes data]
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [512 bytes data]
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
{ [5 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [122 bytes data]
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
{ [19 bytes data]
* TLSv1.3 (IN), TLS handshake, Certificate (11):
{ [2548 bytes data]
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
{ [79 bytes data]
* TLSv1.3 (IN), TLS handshake, Finished (20):
{ [52 bytes data]
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.3 (OUT), TLS handshake, Finished (20):
} [52 bytes data]
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / X25519 / id-ecPublicKey
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=gottahavecoups.com
*  start date: Jan 24 01:17:46 2026 GMT
*  expire date: Apr 24 02:16:10 2026 GMT
*  subjectAltName: host "www.gottahavecoups.com" matched cert's "*.gottahavecoups.com"
*  issuer: C=US; O=Google Trust Services; CN=WE1
*  SSL certificate verify ok.
*   Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA256
*   Certificate level 1: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384
*   Certificate level 2: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
} [5 bytes data]
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: www.gottahavecoups.com]
* [HTTP/2] [1] [:path: /api/v1/deals?limit=20&sort=newest]
* [HTTP/2] [1] [user-agent: curl/8.5.0]
* [HTTP/2] [1] [accept: */*]
} [5 bytes data]


The connection is established but it looks like it might be hanging. Let me check if there's more output.

curl -s "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" --connect-timeout 15 --max-time 20 -o /tmp/deals_raw.json && wc -c /tmp/deals_raw.json && head -1000 /tmp/deals_raw.json


0 /tmp/deals_raw.json


The API is returning an empty response. Let me try with http/1.1 instead of http/2.

curl -s --http1.1 "https://www.gottahavecoups.com/api/v1/deals?limit=20&sort=newest" --connect-timeout 15 --max-time 20 -o /tmp/deals_raw.json && wc -c /tmp/deals_raw.json


The API is returning empty. Let me try hitting the main website instead to see if it's up.

curl -s "https://www.gottahavecoups.com" --connect-timeout 15 --max-time 20 -o /tmp/homepage.html && wc -c /tmp/homepage.html


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


The homepage is also taking a long time. Let me poll for the result.


(no new output)

Process still running.


Let me wait a bit more for it to complete.

sleep 5 && cat /tmp/homepage.html 2>/dev/null | wc -c


The website seems to be unresponsive or returning empty. Let me try using the web_fetch tool instead.


This operation was aborted


The website is timing out. Let me try the base URL.


The website appears to be down or not responding. The task cannot be completed because the API is unreachable. I should report this as a failure.

The gottahavecoups.com API is currently unreachable (timeouts on both the homepage and API endpoints). I cannot fetch deals to post.

**Summary:**
- **Task:** Post 1 deal to X and Pinterest (cron job 6dd85dd2-28ce-411f-b2de-8106e314da47)
- **Status:** FAILED - API unavailable
- **Issue:** https://www.gottahavecoups.com is timing out (both homepage and /api/v1/deals endpoint)
- **Action:** No deals posted; recommend retrying in next scheduled run (30 min)